Using print_r and var_dump with circular reference
I’m using the MVC framework Symfony, and it seems a lot of the built-in objects I want to debug have circular references. This makes it impossible to print the variables with print_r()
or var_dump()
(since they follow circular references ad infinitum or until the process runs out of memory, whichever comes first).