8000 Fixed (string) catchable fatal error for PHP Incomplete Class instances by yceruto · Pull Request #17691 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

yceruto
Copy link
Member
@yceruto yceruto commented Feb 4, 2016
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #17586
License MIT
Doc PR -

@yceruto
Copy link
Member Author
yceruto commented Feb 4, 2016

AppVeyor build failed (not related)

@javiereguiluz
Copy link
Member

👍

Status: reviewed

{
$array = new \ArrayObject($value);

return $array['__PHP_Incomplete_Class_Name'];
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Member

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)

@Tobion
Copy link
Contributor
Tobion commented Feb 11, 2016

👍

@fabpot
Copy link
Member
fabpot commented Feb 11, 2016

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
Copy link
Member Author
yceruto commented Feb 11, 2016

ValueExporter.php has been inserted from 2.4 version (commit)

@stof
Copy link
Member
stof commented Feb 11, 2016

@yceruto but the bug also exists in 2.3. It is just not extracted to a separate class

@yceruto
Copy link
Member Author
yceruto commented Feb 11, 2016

@stof right, I'll create a PR to 2.3

@yceruto
Copy link
Member Author
yceruto commented Feb 11, 2016

I've opened a PR for 2.3 branch (#17766)

@fabpot
Copy link
Member
fabpot commented Feb 12, 2016

Thank you @yceruto.

fabpot added a commit that referenced this pull request Feb 12, 2016
…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
@fabpot fabpot closed this Feb 12, 2016
This was referenced Feb 28, 2016
@yceruto yceruto deleted the ticket_17586 branch November 15, 2016 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0