Skip to content

Fix false-positive unused-variable in declare() {} block - #6755

Closed
alfredbez wants to merge 1 commit into
phpstan:2.3.xfrom
alfredbez:fix/declare-variable-flow
Closed

alfredbez wants to merge 1 commit into
phpstan:2.3.xfrom
alfredbez:fix/declare-variable-flow

Conversation

@alfredbez

Copy link
Copy Markdown
Contributor

Fixes phpstan/phpstan#15394

DeclareHandler omitted variableFlow when constructing InternalStatementResult for statements inside a declare() { ... } block, causing variable flow between surrounding statements and the declare block to be dropped.

@alfredbez

Copy link
Copy Markdown
Contributor Author

Closing in favor of earlier PR #6693 which already addresses phpstan/phpstan#15394.

@alfredbez alfredbez closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Variable in declare() {} block seems not to be considered used

1 participant