-
Notifications
You must be signed in to change notification settings - Fork 574
Check isFirstClassCallable() before calling getArgs() on nested FuncCall nodes
#5564
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
Changes from all commits
275d81e
9445f33
18b34d4
810f7d3
ffe4ab4
a45a0fd
dff735b
ce2e743
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| <?php // lint >= 8.1 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turn this into a AnalyserIntegrationTest as we are covering crash bugs
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. Converted the bug-14550 test from an NSRT test ( |
||
|
|
||
| declare(strict_types = 1); | ||
|
|
||
| namespace Bug14550; | ||
|
staabm marked this conversation as resolved.
|
||
|
|
||
| function testArrayKeyFirstAssign(): void | ||
| { | ||
| $fn = array_key_first(...); | ||
| } | ||
|
|
||
| function testArrayKeyLastAssign(): void | ||
| { | ||
| $fn = array_key_last(...); | ||
| } | ||
|
|
||
| function testArrayRandAssign(): void | ||
| { | ||
| $fn = array_rand(...); | ||
| } | ||
|
|
||
| function testCountMinusOneAssign(): void | ||
| { | ||
| $idx = count(...) - 1; | ||
| } | ||
|
|
||
| function testArraySearchInCondition(): void | ||
| { | ||
| if ($key = array_search(...)) { | ||
| } | ||
| } | ||
|
|
||
| function testCountInComparisons(): void | ||
| { | ||
| if (count(...) < 1) {} | ||
| if (0 < count(...)) {} | ||
| } | ||
|
|
||
| function testSizeofInComparisons(): void | ||
| { | ||
| if (sizeof(...) < 1) {} | ||
| if (0 < sizeof(...)) {} | ||
| } | ||
|
|
||
| function testCountMinusOneInComparison(): void | ||
| { | ||
| $i = 0; | ||
| if ($i < count(...) - 1) {} | ||
| } | ||
|
|
||
| function testStrlenInComparisons(): void | ||
| { | ||
| if (strlen(...) < 1) {} | ||
| if (0 < strlen(...)) {} | ||
| } | ||
|
|
||
| function testMbStrlenInComparisons(): void | ||
| { | ||
| if (mb_strlen(...) < 1) {} | ||
| if (0 < mb_strlen(...)) {} | ||
| } | ||
|
|
||
| function testPregMatchInComparisons(): void | ||
| { | ||
| if (preg_match(...) < 1) {} | ||
| if (0 < preg_match(...)) {} | ||
| } | ||
|
|
||
| function testCountIdentical(): void | ||
| { | ||
| if (count(...) === 0) {} | ||
| } | ||
|
|
||
| function testStrlenIdentical(): void | ||
| { | ||
| if (strlen(...) === 0) {} | ||
| if (mb_strlen(...) === 0) {} | ||
| } | ||
|
|
||
| function testArrayKeyFirstNullComparison(): void | ||
| { | ||
| if (array_key_first(...) !== null) {} | ||
| if (array_key_last(...) !== null) {} | ||
| } | ||
|
|
||
| function testGetClassIdentical(): void | ||
| { | ||
| if (get_class(...) === 'stdClass') {} | ||
| if (get_debug_type(...) === 'string') {} | ||
| } | ||
|
|
||
| function testStringFuncIdentical(): void | ||
| { | ||
| if (strtolower(...) === 'test') {} | ||
| } | ||
|
|
||
| function testGettypeEquality(): void | ||
| { | ||
| if (gettype(...) === 'string') {} | ||
| if (gettype(...) == 'string') {} | ||
| } | ||
|
|
||
| function testGetClassEquality(): void | ||
| { | ||
| if (get_class(...) == 'stdClass') {} | ||
| if (get_debug_type(...) == 'string') {} | ||
| } | ||
|
|
||
| function testGetParentClassEquality(): void | ||
| { | ||
| if (get_parent_class(...) === 'stdClass') {} | ||
| } | ||
|
|
||
| function testTrimEquality(): void | ||
| { | ||
| if (trim(...) !== '') {} | ||
| if (ltrim(...) !== '') {} | ||
| if (rtrim(...) !== '') {} | ||
| } | ||
|
|
||
| function testArrayKeysInForeach(): void | ||
| { | ||
| foreach (array_keys(...) as $key) {} | ||
| } | ||
|
|
||
| function testCountInForLoop(): void | ||
| { | ||
| for ($i = 0; $i < count(...); $i++) {} | ||
| for ($i = 0; count(...) > $i; $i++) {} | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.