title: Why does Symfony2 set the error_reporting?
body: <p>I've been trying to remove the E_NOTICE and E_STRICT error levels to avoid this error:</p>
  
  <pre><code>Runtime Notice: Only variables should be passed by reference
  </code></pre>
  
  <p>I tried modifying php.ini but didn't work, error_reporting always is -1. Then I tried setting it dynamically in the current action, and worked fine. Then I also tried the same in the first line in app_dev.php and didn't work. Which means Symfony2 is setting it dynamically somewhere.</p>
  
  <p>What should I do?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>For those who are not familiar with the error:</p>
  
  <pre><code>$user = $this-&gt;('security.context')-&gt;getToken()-&gt;getUser();
  
  $first = reset($user-&gt;getRoles()); // error
  
  $roles = $user-&gt;getRoles();
  $first = reset($roles); // works fine
  </code></pre>