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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -