Search code examples
phpmagentovar-dump

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


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?


Solution

  • 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());
    }