How to clean dump Doctrine2 entity (entities) without print_r and crash Apache

Have you ever try print_r($entity)? Apache crash? Yes โ€“ exactly. Doctrine2 entity has massive recursion and trying dump by print_r give Apache crash. How to do this safely  and clean?

1echo '<pre>';
2\Doctrine\Common\Util\Debug::dump($entity);
3echo '</pre>';

Have a productive day ๐Ÿ™‚

Leave a Comment: