Too much data with var_dump in symfony2 doctrine2

后端 未结 9 1444
夕颜
夕颜 2020-11-28 02:37

I have around 40 entities and many bidirectional relationships. Whenever i use var_dump($user) or any entity my browser gets loaded with too much data of arrays and variable

9条回答
  •  独厮守ぢ
    2020-11-28 03:15

    Symfony < 2.6

    You can use \Doctrine\Common\Util\Debug::dump($variable, $depth); it displays doctrine output without the proxy information.

    Symfony > 2.6

    If you are using symfony 2.6 or more, I strongly advice you to use dump(). It shows a well formated and colored output, and you can dynamically expend/hide rows.

提交回复
热议问题