Skip to content

Fix arginfos of required arguments for some Reflection methods #3797

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 2 commits into from
Closed

Fix arginfos of required arguments for some Reflection methods #3797

wants to merge 2 commits into from

Conversation

carusogabriel
Copy link
Contributor

Reopening #3443 against master branch (PHP 8.0 now).

This fixes: #74035 and #71416.

/cc @Ocramius @Majkl578

@carusogabriel carusogabriel added this to the PHP 8.0 milestone Feb 7, 2019
@Majkl578
Copy link
Contributor

Majkl578 commented Feb 7, 2019

This is still 👎 from me as it creates a BC break that is not fixable while supporting both PHP 7 and 8 (unless using conditional code).

@nikic
Copy link
Member

nikic commented Feb 7, 2019

@Majkl578 You can, using function invoke($object, $arg1 = null), which is compatible with both function invoke($object, $arg1) and function invoke($object). In fact, you probably already do this (unless your invoke override is completely unused), because otherwise you'd obviously run into argument count errors. Proof: https://3v4l.org/6oIIF

Copy link
Contributor

@Majkl578 Majkl578 left a comment

Choose a reason for hiding this comment

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

@nikic Fair. 👍
But please document this in upgrading guide as a BC break.

@nikic
Copy link
Member

nikic commented Feb 7, 2019

@carusogabriel Please combine this PR and #3798. Let's directly go to the correct variadic signature instead of doing this in two steps...

@carusogabriel
Copy link
Contributor Author

@nikic Okay. Gonna fix a test that's breaking there as well

@nikic
Copy link
Member

nikic commented Feb 8, 2019

When merging this, please add an UPGRADING note that mentions all of the old signatures, the new signatures, and the signatures that can be used to be compatible with both.

@carusogabriel
Copy link
Contributor Author

Merged via 35db1cc. Thanks everyone for the discussion.

@carusogabriel carusogabriel deleted the fix/arginfos-reflection branch February 10, 2019 16:30
@carusogabriel carusogabriel removed this from the PHP 8.0 milestone Apr 25, 2020
@carusogabriel carusogabriel added this to the PHP 8.0 milestone May 29, 2020
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.

4 participants