symfony2 学说 2 中的 var_dump 数据过多 [英] Too much data with var_dump in symfony2 doctrine2
本文介绍了symfony2 学说 2 中的 var_dump 数据过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有大约 40 个实体和许多双向关系.每当我使用 var_dump($user) 或任何实体时,我的浏览器都会加载过多的数组和变量数据,然后它就会崩溃.
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 variables then it just crashed.
我想知道有什么问题.
数据插入正常.我可以在生产中引起问题吗.
The data is being inserted fine. Can i cause issue in production.
推荐答案
将 var_dump() 替换为调试方法 dump() 由 教义通用.
Replace var_dump() with the debug method dump() provided by Doctrine Common.
DoctrineCommonUtilDebug::dump($user);
它适用于单个对象和 Doctrine 集合,应该可以防止浏览器显示您遇到的问题.
It works for single objects and Doctrine collections and should prevent browser displaying issues you are having.
这篇关于symfony2 学说 2 中的 var_dump 数据过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文