Skip to content

Add reproducer for possible issue with object return type inheritance #6961

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

Merged
merged 9 commits into from
May 10, 2021

Conversation

kocsismate
Copy link
Member

Unfortunately, a reproducer is the most I could find out with regard to this issue, which I noticed while working on #6548.

If a method with a declared return type (e.g. mixed, object) is overridden with a class return type (e.g. stdClass), then there's a segfault somewhere in a very early stage, so not even an empty PHP script runs.

Although the issue is reproduced via ReflectionEnumUnitCase::getValue() which overrides ReflectionClassConstant::getValue() - I only had to add a mixed return type to the parent method -, but it is not limited to this case only. So I could trigger the same issue with other classes.

@krakjoe krakjoe force-pushed the object-return-inheritance-bug branch from b222104 to b928ee1 Compare May 10, 2021 05:43
@krakjoe krakjoe self-assigned this May 10, 2021
@nikic
Copy link
Member

nikic commented May 10, 2021

I've addressed part of the issue in 7fbfcfa.

@krakjoe krakjoe force-pushed the object-return-inheritance-bug branch from b1d59c2 to 403eebf Compare May 10, 2021 08:06
@krakjoe krakjoe merged commit fcd1875 into php:master May 10, 2021
@kocsismate
Copy link
Member Author

Thank you both for taking care of this issue! :)

@kocsismate kocsismate deleted the object-return-inheritance-bug branch May 10, 2021 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants