Repository navigation
Preserve source types during destructuring assignments - #6760
Open
Gabrieljr42 wants to merge 2 commits into
Open
Gabrieljr42 wants to merge 2 commits into
Gabrieljr42 wants to merge 2 commits into
Conversation
Author
|
I checked the two E2E failures. The parse-error case has the same "expected 1, got 0" failure on the current 2.3.x base. The other job stopped while downloading the bashunit checksum, before running its tests. Both local full suites passed, with and without Turbo. |
Gabrieljr42
force-pushed
the
fix/destructuring-rhs-types
branch
from
October 25, 2026 15:00
45bd1bb to
578a76d
Compare
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.
Fixes phpstan/phpstan#15091.
Also covers phpstan/phpstan#15181.
When an earlier destructuring target overwrites the source variable, later targets must still use the original source type. Capture both the PHPDoc and native source types before assigning any items, in the PHP and Turbo implementations.
The regression covers positional and keyed assignments, nested destructuring, skipped slots, callable values and a source variable reused in a later target.
Validation on PHP 8.3.6:
The Compile PHAR integration matrix currently stops during Composer installation in the two phpstan-laravel jobs, before running the analyzer. The external integration lock pins Laravel 13.35.0, PHPStan 2.3.1 and structarmed 0.18.11, while the updated fixture requires at least Laravel 13.38.0, PHPStan 2.3.2 and structarmed 0.19.3. See the installation failure. The integration lock fix is submitted separately in phpstan/phpstan#15536, where both phpstan-laravel integration jobs now pass in CI. With that fix, the pinned fixture installs and all 3,031 integration tests plus static analysis pass locally on PHP 8.5.12 using this PR’s PHAR and matching Turbo artifacts. No CI check has been disabled or relaxed in this PR.
I used AI assistance for the implementation, tests and branch update.