Pretty dump variable/object in Symfony 2.*?

Michael picture Michael · Mar 24, 2013 · Viewed 17.3k times · Source

When developing stuff I need to output the state of some instance in order to inspect it.

While using CakePHP I always had a debug() function which does some kind of var_dump inside a <pre> html element, so the content is readable.

Is something similar in Symfony 2.x too?

Answer

Pedro Luz picture Pedro Luz · May 21, 2014
exit(\Doctrine\Common\Util\Debug::dump($someVar));