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.
i want to whats the problem.
The data is being inserted fine. Can i cause issue in production.
Definition and Usage The var_dump() function dumps information about one or more variables. The information holds type and value of the variable(s).
It's too simple. The var_dump() function displays structured information about variables/expressions including its type and value. Whereas The print_r() displays information about a variable in a way that's readable by humans. Example: Say we have got the following array and we want to display its contents.
@JMTyler var_export returns a parsable string—essentially PHP code—while var_dump provides a raw dump of the data. So, for example, if you call var_dump on an integer with the value of 1, it would print int(1) while var_export just prints out 1 .
var_dump() displays values along with data types as output. print_r() displays only value as output. It does not have any return type. It will return a value that is in string format.
Replace var_dump() with the debug method dump() provided by Doctrine Common.
\Doctrine\Common\Util\Debug::dump($user);
It works for single objects and Doctrine collections and should prevent browser displaying issues you are having.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With