I always end up discovering a lot of crazy things in this language that I love so much: PHP!
What would this mysterious class __PHP_Incomplete_Class
?
I accidentally "found" her when I gave her a get_declared_classes
Then, in my curiosity, I tried to instantiate it.
$incomplete = new __PHP_Incomplete_Class;
However, when I try to access or assign a value to any property, a Notice
is generated:
$incomplete = new __PHP_Incomplete_Class;
$incomplete->test = 'teste';
Notice : main (): The script tried to execute a method or access to property of an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on is unserialize () gets called or provide a __autoload () function to load the class definition in / var / www /lab/index.php on line 5
What would be this error?
What would this __PHP_Incomplete_Class
?
And where did this main
appear in the Notice that was generated?
Update:
In addition to everything that has been said before, there is yet another interesting question about __PHP_Incomplete_Class
: The function is_object
returns FALSE
when we check it.
See:
var_dump(is_object(new __PHP_Incomplete_Class())); // (boolean) false