Skip to content

Do not crash when a closure unsets a variable it captured by reference - #12022

Merged
danog merged 2 commits into
vimeo:masterfrom
danog:fix-byref-unset-crash
Sep 28, 2026
Merged

danog merged 2 commits into
vimeo:masterfrom
danog:fix-byref-unset-crash

Conversation

@danog

@danog danog commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

function () use (&$x) { unset($x); } crashed with an undefined array key when the variable's type after the closure was computed.

Split out of #12013.

🤖 Generated with Claude Code

`function () use (&$x) { unset($x); }` crashed with an undefined array key when the variable's type after the closure was computed.

Co-Authored-By: Claude Opus 5.5 

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php
@danog danog added the release:fix The PR will be included in 'Fixes' section of the release notes label Sep 28, 2026
@danog

danog commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

bugbot review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@danog

danog commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

bugbot review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@danog

danog commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5ba362a. Configure here.

@danog
danog merged commit 65a4480 into vimeo:master Sep 28, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix The PR will be included in 'Fixes' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant