Let's say you access an object that you do not know how it was created and wants to know if it was instantiated as new \Acme\Foo()
or if it was just returned \Acme\Foo
;
What is the most practical test? (removed the requirement "without using Reflection")
Example:
<?php
$foo = App::getService('foo');
App::getService()
returned an object that is stored in $foo
;
$foo
is a dynamic object?