<p dir="auto">Because of PHP 7, <code class="notranslate">Symfony\Component\Console\Application::renderException()</code> should also accept <code class="notranslate">\Throwable</code> type.</p>
<p dir="auto">when a command throws a fatal error in PHP7, the exception produced is handled by global error handler, not application error handler.</p>
<p dir="auto">thus the error message is properly handled, but the exit code is not.</p>
<p dir="auto">such code for example (for tests or more) could lead to such behavior, under Symfony 2.8 / PHP 7<br>
<code class="notranslate">$a = null; $a-&gt;getSmth();</code><br>
under PHP 5.3 the above command execution would exit with non zero exit code.<br>
under PHP7.* this would end up with exit code being zero, which is not good.</p>
<p dir="auto">the problem is in the - Symfony/Component/Console/Application.php:124,<br>
where only \Exception class is catched<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="180367986" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/20111" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/20111/hovercard" href="https://github.com/symfony/symfony/pull/20111">#20111</a></p>