Why does var_dump(array) result in a 500 error in Magento?

pancake picture pancake · Jul 28, 2011 · Viewed 7.1k times · Source

I'm trying to see what is inside all the objects of the Magento system, but when I try to var_dump the $_links variable (containing all information needed for rendering the links in the header of every page) from inside the top links template, my server responds with a 500 error. Anyone know why?

Answer

clockworkgeek picture clockworkgeek · Jul 28, 2011

Dumps of Magento objects get a bit messy, even if there isn't recursion there is all the EAV and cache stuff. When you have an array you'll need to dump them individually:

foreach ($_links as $object) {
    var_dump($object->debug());
}