<p dir="auto"><strong>Symfony version(s) affected</strong>: 4.1.0</p>
<p dir="auto"><strong>Description</strong><br>
When two services with different names are implemented by the same class the compiled container become broken with PHP fatal error.</p>
<p dir="auto"><strong>How to reproduce</strong></p>
<ol dir="auto">
<li>Create the following services declaration:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="        &lt;service id=&quot;bar&quot; class=&quot;foo&quot; lazy=&quot;true&quot;/&gt;
        &lt;service id=&quot;baz&quot; class=&quot;foo&quot; lazy=&quot;true&quot;/&gt;"><pre class="notranslate"><code class="notranslate">        &lt;service id="bar" class="foo" lazy="true"/&gt;
        &lt;service id="baz" class="foo" lazy="true"/&gt;
</code></pre></div>
<ol start="2" dir="auto">
<li>Create empty class definition <code class="notranslate">class foo {}</code>.</li>
<li>Compile the container and run compiled version.</li>
</ol>
<p dir="auto">Expected: Normal lazy-loaded operation.</p>
<p dir="auto">Actual:</p>
<blockquote>
<p dir="auto">Fatal error: Cannot declare class foo_40d7466, because the name is already in use in path-to-container\container-name.php on line 13706</p>
</blockquote>
<p dir="auto"><strong>Possible Solution</strong><br>
Pass service id to the hash suffinx generator function or don't duplicate definition of the same proxied class.</p>
<p dir="auto">on my controller:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="return $this-&gt;render('AppBundle:Site:index.html.twig', array(
'form' =&gt; $form-&gt;createView()
));"><pre class="notranslate"><code class="notranslate">return $this-&gt;render('AppBundle:Site:index.html.twig', array(
'form' =&gt; $form-&gt;createView()
));
</code></pre></div>
<p dir="auto">on index.html it's show's the form. but on my index.html.twig i have:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{% extends 'AppBundle::layout.html.twig' %}
{{ form_start(form) }}
{{ form_widget(form) }}
{{ form_end(form) }}"><pre class="notranslate"><code class="notranslate">{% extends 'AppBundle::layout.html.twig' %}
{{ form_start(form) }}
{{ form_widget(form) }}
{{ form_end(form) }}
</code></pre></div>
<p dir="auto">any nothing will show. symfony show only on index.html.twig but no also on the twig like load it once. i'm using Symfony 3.1 thanks</p>