Dumping Object/Array Stacks in Symfony

Submitted by Peter Majmesku on Mon, 07/10/2017 - 13:54

I prefer using XDebug for debugging PHP code. But sometimes there's a huge nesting in the project, which makes the application very slow. Then XDebug can become pain. So there's an alternative for inspecting the contents of objects:

\Doctrine\Common\Util\Debug::dump($user);

It works for single objects and Doctrine collections and should prevent browser displaying issues you are having.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.