<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.4.*</td>
</tr>
<tr>
<td>PHP version</td>
<td>5.6.25</td>
</tr>
</tbody>
</table>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/613da8e43eca3b7423112f537ae44eb6fb2243d9e43a68073a4fbc1991510104/68747470733a2f2f696d6775722e636f6d2f735a527145674b"><img src="https://camo.githubusercontent.com/613da8e43eca3b7423112f537ae44eb6fb2243d9e43a68073a4fbc1991510104/68747470733a2f2f696d6775722e636f6d2f735a527145674b" alt="Stacktrace" data-canonical-src="https://imgur.com/sZRqEgK" style="max-width: 100%;"></a></p>
<p dir="auto">We're currently upgrading a Symfony project to 3.4 on PHP 5.6.25 and my colleague has been having this issue since I've added the following block of code to our <code class="notranslate">AppKernel::registerContainerConfiguration</code> method:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="        $loader-&gt;load(function (ContainerBuilder $container) {
            $container-&gt;setParameter('container.autowiring.strict_mode', true);
            $container-&gt;setParameter('container.dumper.inline_class_loader', true);
            $container-&gt;addObjectResource($this);
        });"><pre class="notranslate"><code class="notranslate">        $loader-&gt;load(function (ContainerBuilder $container) {
            $container-&gt;setParameter('container.autowiring.strict_mode', true);
            $container-&gt;setParameter('container.dumper.inline_class_loader', true);
            $container-&gt;addObjectResource($this);
        });
</code></pre></div>
<p dir="auto">It only happened on a second request, and often it had to be a different request, not just the same one (aka refresh didn’t cause it).</p>
<p dir="auto">He found two ways to make it work :</p>
<ol dir="auto">
<li>Commenting out the line <code class="notranslate">$container-&gt;setParameter('container.dumper.inline_class_loader', true);</code>, or</li>
<li>Commenting out the line <code class="notranslate">$kernel-&gt;loadClassCache();</code> in <code class="notranslate">app_dev.php</code></li>
</ol>
<p dir="auto">I personally can't reproduce the issue on my setup. Any idea what might be happening here ?</p>
<p dir="auto">Also, it might look like we're not the only ones : <a href="https://stackoverflow.com/questions/47617879/symfony-duplicate-class-definition-in-cache" rel="nofollow">https://stackoverflow.com/questions/47617879/symfony-duplicate-class-definition-in-cache</a></p>
<p dir="auto">Thanks for your help.<br>
gnutix</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>yes</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.3.0</td>
</tr>
</tbody>
</table>
<p dir="auto">Custom tags support is a very important feature imo that currently lacks to the yaml component.<br>
It is basically allowing things like:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="services:
    square_printer:
        arguments: [ !color red ]"><pre class="notranslate"><span class="pl-ent">services</span>:
    <span class="pl-ent">square_printer</span>:
        <span class="pl-ent">arguments</span>: <span class="pl-s">[ !color red ]</span></pre></div>
<p dir="auto">By having a dedicated system for tags, we could centralize their management and avoid duplication (<a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Yaml/Inline.php#L576-L616">here</a> and <a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Yaml/Parser.php#L561-L568">here</a>).<br>
If wanted, it could also be used in the core to remove reserved keys in config files.<br>
For example,</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="services:
    _defaults:
        autowire: true

    my_service:
        class: FooBar
        arguments:
            - '@service1'
            - =iterator:
                - '@service2'
                - '@service3'

# could become
services:
    !defaults:
        autowire: true

    my_service:
        class: FooBar
        arguments:
            - '@service1'
            - !iterator
                - '@service2'
                - '@service3'"><pre class="notranslate"><span class="pl-ent">services</span>:
    <span class="pl-ent">_defaults</span>:
        <span class="pl-ent">autowire</span>: <span class="pl-c1">true</span>

    <span class="pl-ent">my_service</span>:
        <span class="pl-ent">class</span>: <span class="pl-s">FooBar</span>
        <span class="pl-ent">arguments</span>:
            - <span class="pl-s"><span class="pl-pds">'</span>@service1<span class="pl-pds">'</span></span>
            - <span class="pl-ent">=iterator</span>:
                - <span class="pl-s"><span class="pl-pds">'</span>@service2<span class="pl-pds">'</span></span>
                - <span class="pl-s"><span class="pl-pds">'</span>@service3<span class="pl-pds">'</span></span>

<span class="pl-c"><span class="pl-c">#</span> could become</span>
<span class="pl-ent">services</span>:
    <span class="pl-s">!defaults:</span>
        <span class="pl-ent">autowire</span>: <span class="pl-c1">true</span>

    <span class="pl-ent">my_service</span>:
        <span class="pl-ent">class</span>: <span class="pl-s">FooBar</span>
        <span class="pl-ent">arguments</span>:
            - <span class="pl-s"><span class="pl-pds">'</span>@service1<span class="pl-pds">'</span></span>
            - <span class="pl-k">!iterator</span>
                - <span class="pl-s"><span class="pl-pds">'</span>@service2<span class="pl-pds">'</span></span>
                - <span class="pl-s"><span class="pl-pds">'</span>@service3<span class="pl-pds">'</span></span></pre></div>
<p dir="auto">WDYT?</p>