Language: keep arrow captures beside null in new args (#31720) - #31725
Merged
Conversation
5 tasks
PurHur
force-pushed
the
agent/issue-31720-arrow-new-null-capture
branch
from
August 17, 2026 00:58
4845358 to
c1e8577
Compare
3 tasks
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.
Summary
fn() => new Pair($x, null)/new Pair(null, $x)dropped auto-captured$xon VM (both args became null) while Zend kept the capture.null/true/falseConstFetch folding treated named CV / Phi temps as dead inline args.compileOperandfor named CVs when a trailing bool/null ConstFetch prelude is present; do not treat named CVs as enum prelude slots.Closes #31720
php-src:
Zend/zend_compile.c(arrow auto-capture +ZEND_AST_NEW)Test plan
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_arrow_new_null_arg.php'(Zend) matches VM./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_arrow_new_null_arg.php'./script/phpunit.sh --filter ArrowNewNullCapture31720Test→ OK (2 tests, 11 assertions)Made with Cursor