Dumping doctrine entities without print_r

I’ve run into a problem with a personal project I’ve been working on, whereby my normal debugging process is to ensure I’m getting the correct data from the database using php’s print_r function. Recently this has been causing Apache to hang on my laptop, due to the massive quantity of memory PHP uses when trying to dump doctrine entities. After a bit of searching through the Doctrine documentation, I found a Doctrine dump function that will properly dump out a Doctrine object without the massive recursion / memory requirements.

So, without further adieu:

print "\<pre\>";
print "\</pre\>";


print "\<pre\>";
print "\</pre\>";

1 Comments Add Yours ↓

  1. Ulf #

    Perfect. Thank you!

Your Comment