Search code examples
phpsymfonysymfony-3.3

Symfony 3.3 getting stacktrace when an Exception gets thrown over the cli command (eg server:start)


Over my Symfony 3.3 project when I run a cli command such as:

php ./bin/console server:start

Sometimes an error has been thrown eg:

  [Symfony\Component\Debug\Exception\ContextErrorException]      
  Warning: key() expects parameter 1 to be array, boolean given  

So using Xdebug I will debug it, but this it can be time-consuming. So finding its stacktrace would be beneficial in order to put breakpoints to the correct places.

So how can I get the stacktrace over a "systematic" exception that gets thrown over the framework?


Solution

  • Yes, it's annoying. It's a know issue of Symfony. It will be fixed as of Symfony 3.4: