-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fixed (string) catchable fatal error for PHP Incomplete Class instances #17691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #17586 |
License | MIT |
Doc PR | - |
AppVeyor build failed (not related) |
👍 Status: reviewed |
{ | ||
$array = new \ArrayObject($value); | ||
|
||
return $array['__PHP_Incomplete_Class_Name']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cant u just access this as a property without arrayobject?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$foo = new \__PHP_Incomplete_Class();
echo $foo->__PHP_Incomplete_Class_Name;
results in:
The script tried to execute a method or access a property of an incomplete object.
Please ensure that the class definition "unknown" of the object you are trying to
operate on was loaded _before_ unserialize() gets called or provide a __autoload()
function to load the class definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, __PHP_Incomplete_Class is really weird (the fact that is_object
returns false for it is a first WTF, but not the only one)
👍 |
This one should be merged in 2.7, but first, we need a PR on 2.3 as the bug probably exists there as well. |
|
@yceruto but the bug also exists in 2.3. It is just not extracted to a separate class |
@stof right, I'll create a PR to 2.3 |
I've opened a PR for 2.3 branch (#17766) |
Thank you @yceruto. |
…ass instances (yceruto) This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #17691). Discussion ---------- Fixed (string) catchable fatal error for PHP Incomplete Class instances | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17586 | License | MIT | Doc PR | - Commits ------- 4b7ed98 avoid (string) catchable fatal error for instances of __PHP_Incomplete_Class