Skip to content
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

Bugfix for #73987 #2342

Closed
wants to merge 2 commits into from
Closed

Bugfix for #73987 #2342

wants to merge 2 commits into from

Conversation

pmmaga
Copy link
Contributor

@pmmaga pmmaga commented Jan 27, 2017

Inheritance checks should not ignore parents if these implement an interface or abstract.

Link for bugsnet: https://bugs.php.net/bug.php?id=73987

@krakjoe krakjoe added the Bug label Jan 27, 2017
@krakjoe krakjoe self-assigned this Jan 27, 2017
@krakjoe
Copy link
Member

krakjoe commented Jan 27, 2017

@nikic @bwoebi can I get your input on this please ... it may be pernicious to merge this into released branches right now ?

@nikic nikic self-requested a review January 27, 2017 17:43

?>
--EXPECTF--
Fatal error: Declaration of B::example($a, $b, $c = NULL) must be compatible with A::example($a, $b = NULL, $c = NULL) in %s
Copy link
Member

@nikic nikic Jan 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC the rule is that an incompatibility with an interface throws a fatal error, while an incompatibility with a (non-abstract) class signature only generates a warning. As such, shouldn't this be a warning? (Same for the other cases as well, of course).

Copy link
Member

@nikic nikic Jan 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, just saw that we always fatal for return types. In that case it's fine.

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I'd recommend landing this in 7.1+ only for now, as there is a potential of fallout from code that accidentally specified wrong signatures due to this bug.

@pmmaga
Copy link
Contributor Author

pmmaga commented Jan 27, 2017

Thanks for the review! Agreed

@krakjoe
Copy link
Member

krakjoe commented Jan 28, 2017

Merged b67eb34

Thanks.

@krakjoe krakjoe closed this Jan 28, 2017
eXtreme added a commit to eXtreme/flysystem-cached-adapter that referenced this pull request Jun 5, 2018
See the reason:

https://3v4l.org/VDT0P

The behavior was changed with this PR: php/php-src#2342 but somehow got left undocumented in upgrade file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants