About dependency injector and var_dump

When passing an object that extends PhalconModel to var_dump(), the output will show all the object properties plus what looks like my Dependency Injector (!!!). However, there is a ->dump() function in all objects that extend Phalcon\Model that can be used with var_dump() to output a clean version of the object.

How do I output a clean version of the objects contained in an array?

$myArray = [...bunch of objects...];
var_dump($myArray);

The output from the code above will show all objects plus a dump of the Dependency Injector for each one of them, making it impossible to analyze/debug the array contents. And if one of those objects contains another object as one of its properties the rabbit hole will only get deeper.

In general theory, var_dump() is not the way to do it with OOP in any case. You need to know your objects, to have some interface or public methods/properties to work with etc. What would you do in Java? Dump bytecode? No, you'll read description of the class you need to work with and use only what's in your accessibile scope.