Category
language · php-src-strict · compiler lowering
Problem
Nullsafe method calls with inline expression arguments (e.g. IIFE) fail at compile time instead of short-circuiting on a null receiver. Zend compiles and runs correctly; VM fatals in outerSiblingInlineCallArgProducerSlot() because compileNullsafeMethodCall() omits the CFG call op when lowering argument sends.
| Repro |
Zend 8.2+ |
VM (2026-07-07) |
$c?->f((function(){ return 1; })()) with $c = null |
NULL (arg not evaluated) |
TypeError in Compiler.php:36609 |
php-src reference
PHP implementation target
lib/Compiler.php — compileNullsafeMethodCall() must pass $expr as $cfgCallOp to compileCallArgSends() (mirror compileMethodCallOpcodes)
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter nullsafe_method_args_short_circuit'
Done when
Category
language· php-src-strict · compiler loweringProblem
Nullsafe method calls with inline expression arguments (e.g. IIFE) fail at compile time instead of short-circuiting on a null receiver. Zend compiles and runs correctly; VM fatals in
outerSiblingInlineCallArgProducerSlot()becausecompileNullsafeMethodCall()omits the CFG call op when lowering argument sends.$c?->f((function(){ return 1; })())with$c = nullNULL(arg not evaluated)TypeErrorinCompiler.php:36609php-src reference
Zend/zend_compile.c— nullsafe method call compile + argument evaluation short-circuitPHP implementation target
lib/Compiler.php—compileNullsafeMethodCall()must pass$expras$cfgCallOptocompileCallArgSends()(mirrorcompileMethodCallOpcodes)Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter nullsafe_method_args_short_circuit'Done when
test/compliance/cases/language/nullsafe_method_args_short_circuit.phptpasses VMtest/repro-maintainer/nullsafe_method_args.phpmatches Zend