PHP reflection - Is an object fully constructed -
PHP reflection - Is an object fully constructed -
the method newinstancewithoutconstructor ( reflection class - new instance without construtctor ) can used instantiate object without calling constructor.
is there way determine whether has been case?
for example
$obj = new myclass('b', 'c'); $reflect = new reflectionclass('myobj') $obj2= $reflect->newinstancewithoutconstructor();
is there way determine $obj
constructed , $obj2
not?
only if implement in myclass check that:
class myclass { public $constructorcalled = false; public function __construct() { $this->constructorcalled = true; } }
php reflection
Comments
Post a Comment