<p dir="auto">Hi,</p>
<p dir="auto">There is a strange "if" in the RedirectResponse class.<br>
<a href="https://github.com/symfony/http-foundation/blob/master/RedirectResponse.php#L45">https://github.com/symfony/http-foundation/blob/master/RedirectResponse.php#L45</a></p>
<p dir="auto"><code class="notranslate">if (301 == $status &amp;&amp; !array_key_exists('cache-control', $headers)) { $this-&gt;headers-&gt;remove('cache-control'); }</code></p>
<p dir="auto">The "not" array_key_exists" seems wrong, because why try to remove the header if the header is not present...</p>
<p dir="auto">Am i missing something ?</p>
<p dir="auto">Hello, i just upgraded from Symfony 2.5 to Symfony 2.7 and i'm having this issue. On:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$tags = new ArrayCollection(
       array_unique(array_merge($interests-&gt;toArray(), $skills-&gt;toArray()))
);"><pre class="notranslate"><span class="pl-s1"><span class="pl-c1">$</span>tags</span> = <span class="pl-k">new</span> <span class="pl-v">ArrayCollection</span>(
       array_unique(array_merge(<span class="pl-s1"><span class="pl-c1">$</span>interests</span>-&gt;<span class="pl-en">toArray</span>(), <span class="pl-s1"><span class="pl-c1">$</span>skills</span>-&gt;<span class="pl-en">toArray</span>()))
);</pre></div>
<p dir="auto">i get the error <strong>Error: Nesting level too deep - recursive dependency?</strong>  every time i call the array_unique function for removing duplicates out of an array of objects.<br>
I changed the xdebug.max_nesting_level from 100 to 2000, restarted the services and also disabled xdebug but i still get the same error.</p>
<p dir="auto">Any idea?<br>
Thanks</p>