ZF2 exception handler suppreses PHP parse errors
When producing a parse error, e.g. inside a Controller, ZF2 exception handler catches it and I only see
An error occurred during execution; please try again later. No exception available
If I produce a parse error inside public/index.php I can see the plain PHP error in the browser, so PHP settings are correct.
How do I force ZF2 to show errors like this in dev mode?
Turns out I was using an old version of view/error/index.phtml (part of skeleton app) which was not prepared for errors of type Error (since PHP 7) and only handled errors of type Exception.
Had to change this line
<?php if(isset($this->exception) && $this->exception instanceof Exception): ?>
<?php if (isset($this->exception) && ($this->exception instanceof \Exception || $this->exception instanceof \Error)) : ?>