Repository navigation
fix(arrays): a destructuring condition rules out the null a null value gives its variables - #14607
Merged
orklah merged 1 commit intoNov 23, 2026
Conversation
…e gives its variables vimeo#10668 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Behaviour change
Not run: the full test suite (CI runs it). |
Contributor
✅ Performance: unchanged · Types: decreased
How to read this table
✅ symfony: issues +0 −2Memory 3 599 → 3 599 MB (<0.1 %) · Wall 198.4 → 205.4 s (+3.5 %) Weighted 98 403 → 98 397 (−6, −0.01 %): L3 −2
Removed (2)
✅ php-parser: issues +1 −3Memory 226 → 226 MB (<0.1 %) · Wall 7.4 → 7.5 s (+2.3 %) Weighted 21 245 → 21 239 (−6, −0.03 %): L3 −2
Changed in place (1) @@ lib/PhpParser/NodeTraverser.php:264 @@
- MixedArgumentTypeCoercion: Argument 2 of array_splice expects int, but parent type array-key|null provided
- PossiblyNullArgument: Argument 2 of array_splice cannot be null, possibly null value provided
+ MixedArgumentTypeCoercion: Argument 2 of array_splice expects int, but parent type array-key providedRemoved (1)
head 8e4b40a · base 11ded6c (merge-base) · workflow run |
Collaborator
|
Thanks @jirkace! |
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.
A destructuring used as a condition (
if ([$a, $b] = f())) keeps thenullits variables only get when the value isnull, which the condition rules out.Before
After
Fixes #10668