I have a very strange problem, when I try to var_dump (or print_r) a Doctrine Object, my Apache responses with an empty blank page (200 OK header). I can var_dump a normal php var like:
$dummy = array('a' => 1, 'b' =>2);
And it works fine. But I can’t with any object from any Doctrine class, (like a result from $connection->query(), or an instance of a class from my object model with Doctrine).
Anybody knows why this happens?
I’ve had that sometimes when trying to
print_r()a self-referencing object – it gets into a loop and runs out of memory. Possibly that’s what’s happening to you.Try increasing the memory limit (
ini_set('memory_limit', '256M');) and see if that fixes it.Edit: I don’t think there’s an actual fix for this – it’s PHP’s internal
var_dump/print_rthat don’t limit depth on recursion (or don’t do it properly, at least). If you install the XDebug extension, this can replace the built-invar_dumpwith a version that handles recursion much better.