Category
Language · php-src-strict · clone-with / readonly reinit (re-#9803, #16676, #7250, #10108)
Problem
Under PHP_COMPILER_PROFILE=8.4 (and 8.5/8.6), CloneWithDesugar rewrites clone($obj, ['prop' => $v]) / clone $obj with { … } into calls to phpc_clone_with_begin / phpc_clone_with_end / phpc_clone_with_reinit. Those helpers are listed in ext/standard/Module.php but are not callable on the VM/JIT path — execution dies with Error: Call to undefined function phpc_clone_with_begin().
function_exists('phpc_clone_with_begin') is also false. Host unit suite CloneWithTest reports 10 errors + 1 failure on the same undefined-helper symptom (2026-07-24).
| Repro |
Zend 8.4+ (php-src) |
VM PROFILE=8.4 (2026-07-24) |
clone($a, ['x' => 2]) then echo $b->x,$b->y |
2,9 |
Error: Call to undefined function phpc_clone_with_begin() |
clone $c with { x: 2 } (readonly reinit) |
2 |
same undefined helper |
function_exists('phpc_clone_with_begin') |
n/a (user API) |
false |
Host Zend 8.2 correctly parse-fatals the syntax; the gap is forward-profile clone-with acceptance without a working runtime helper.
php-src reference
PHP implementation target
Repro
./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/clone_with_phpc_begin_undefined.php'
# also: PHP_COMPILER_PROFILE=8.4 ./script/phpunit.sh --filter CloneWithTest
Minimal inline:
./script/docker-exec.sh -- bash -lc "PHP_COMPILER_PROFILE=8.4 php bin/vm.php -r 'class C{public function __construct(public int \$x=1,public int \$y=0){}} \$a=new C(1,9); \$b=clone(\$a,[\"x\"=>2]); echo \$b->x,\",\",\$b->y,\"\\n\";'"
Done when
Category
Language· php-src-strict · clone-with / readonly reinit (re-#9803, #16676, #7250, #10108)Problem
Under
PHP_COMPILER_PROFILE=8.4(and 8.5/8.6),CloneWithDesugarrewritesclone($obj, ['prop' => $v])/clone $obj with { … }into calls tophpc_clone_with_begin/phpc_clone_with_end/phpc_clone_with_reinit. Those helpers are listed inext/standard/Module.phpbut are not callable on the VM/JIT path — execution dies withError: Call to undefined function phpc_clone_with_begin().function_exists('phpc_clone_with_begin')is also false. Host unit suiteCloneWithTestreports 10 errors + 1 failure on the same undefined-helper symptom (2026-07-24).PROFILE=8.4(2026-07-24)clone($a, ['x' => 2])then echo$b->x,$b->y2,9Error: Call to undefined function phpc_clone_with_begin()clone $c with { x: 2 }(readonly reinit)2function_exists('phpc_clone_with_begin')falseHost Zend 8.2 correctly parse-fatals the syntax; the gap is forward-profile clone-with acceptance without a working runtime helper.
php-src reference
Zend/zend_objects.c—zend_objects_clone_obj_with()Zend/zend_language_parser.y— clone-with / clone property listCloneWithJitHelper)PHP implementation target
phpc_clone_with_begin/_end/_reinitfromext/standard/phpc_clone_with_*.phpare registered and dispatchable on VM (same class of bug as Regression: non-exhaustive match() throws Error via missing phpc_match_unhandled_operand_is_object — not UnhandledMatchError (re-#13955, Zend/zend_exceptions.c) #22820 /phpc_match_unhandled_operand_is_object)lib/Ast/CloneWithDesugar.php+CloneWithSupport/CloneWithJitHelperas SSOT — fix registration/lookup, do not growruntime/*.cCloneWithReinitRuntimemust resolve the same helpersRepro
Minimal inline:
./script/docker-exec.sh -- bash -lc "PHP_COMPILER_PROFILE=8.4 php bin/vm.php -r 'class C{public function __construct(public int \$x=1,public int \$y=0){}} \$a=new C(1,9); \$b=clone(\$a,[\"x\"=>2]); echo \$b->x,\",\",\$b->y,\"\\n\";'"Done when
clone($obj, ['x' => 2])andclone $obj with { x: 2 }succeed on VM underPROFILE=8.4with Zend-matching property overrides / readonly reinitCloneWithTestgreen (VM + JIT when LLVM present).phptundertest/compliance/cases/for clone-with