5
Say you access an object you don’t know how it was created and you want 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?
@gmsantos see if the example helped ?
– gpupo
Why not use Reflection?
– Marcelo Aymone
removed the requirement "without using Reflection"
– gpupo