Repository navigation
Conversation
drewmt
force-pushed
the
fix/declare-variable-flow
branch
from
October 7, 2026 14:15
fc82283 to
55d1b44
Compare
Contributor
Author
|
Rebased onto current 2.3.x and refreshed the Turbo pin; the 34 rule tests pass in both modes, along with the native build, smoke tests and signature parity. All twelve downstream failure diagnostic sets on the previous head also occur in the upstream pin-only PR #6696. New-head CI is running. |
drewmt
force-pushed
the
fix/declare-variable-flow
branch
from
October 8, 2026 17:32
55d1b44 to
d17834c
Compare
Contributor
Author
|
Refreshed the rebase after the new Turbo pin conflict, preserving the original fix and upstream commits. Full suites pass in both modes (22,457 tests each), with the rebuilt native version, smoke and signature parity verified. New-head CI is running. |
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#15394.
Variables used inside a
declareblock are currently reported as unread. The inverse is also missed: assignments inside the block disappear from unused-variable analysis, including a block overwriting a value assigned outside it.DeclareHandleralready processes the nested statements, but drops theirVariableFlowwhen returning the result. Forward that flow in both the PHP handler and its Turbo counterpart, leaving statement-only declarations unchanged. The separate native version bump follows the existing coupling requirement.The regression covers reads inside a block, writes read afterwards, nested and alternative-syntax blocks, real unused writes, overwritten outer values, and statement-only declarations. It fails before the fix with three false positives and both expected real diagnostics missing.
Validation:
UnusedVariableRuleTestcases pass.selfmismatch on the clean base and this branch; complete checker output is byte-identical. Those unrelated headers were not regenerated. Local clang-tidy 21 is unavailable; cross-platform and integration CI remain to be checked upstream.