Remove assert() on CallLike::getArgs(), returns empty array on first class callable#1138
Open
samsonasik wants to merge 1 commit intonikic:masterfrom
Open
Remove assert() on CallLike::getArgs(), returns empty array on first class callable#1138samsonasik wants to merge 1 commit intonikic:masterfrom
samsonasik wants to merge 1 commit intonikic:masterfrom
Conversation
Contributor
Author
|
Ready for review 👍 |
Contributor
|
This would be great improvement 👍 as the expectation would be code-dependent, not server-dependent. |
Contributor
|
I disagree, this would be a BC break and a source of hard-to-find bugs. |
Contributor
|
Also, we need to think about the design of Partial Function Application calls in the AST for PHP 8.6. |
Contributor
Author
|
@ondrejmirtes the signature doesn't change, it returns ini_set('zend.assertions', '0');
assert(true === false);
echo "here executed";which tool may can't control as can happen on This make consistent, all Arg, or empty. I am open for optional parameter flag, but that seems will be error incompatible param on child of ClassLike on custom Node. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In tools like
RectorandPHPStan, we usegetArgs()a lot, which it will trigger assert error:when enabling:
I think to avoid repetitive check:
We can carefully check that, but sometime, we forgot.
I think the returns can be early return empty array when it is first class callable.
User that want to get both
ArgandVariadicPlaceholdercan use->argspublic property instead./cc @TomasVotruba @ondrejmirtes @ruudk @staabm