Summary
On current master (4c4c300), AOT binaries mis-compile classes using PHP 8.4 asymmetric property visibility. A public private(set) int property read returns garbage (uninitialized slot) and the set-visibility guard never raises, so program output diverges from VM/JIT. script/capability-syntax.php regeneration in the pinned container now honestly flips the row to AOT=no (synced in the capability doc-sync PR).
Repro
<?php
class C { public private(set) int $x = 1; public function bump(): void { $this->x++; } }
$c = new C(); $c->bump(); echo $c->x, "\n";
try { $c->x = 5; } catch (Error $e) { echo "caught: ", $e->getMessage(), "\n"; }
| Driver |
Output |
rc |
bin/vm.php |
2 + caught: Cannot modify public private(set) property C::$x from global scope |
0 |
./phpc build + run (AOT) |
446409552 (garbage int, no caught line) |
0 |
Environment: php-compiler:22.04-dev (PHP 8.2.31, LLVM 9), PHP_COMPILER_LLVM_PATH=/opt/llvm9.
php-src reference
Zend/zend_compile.c ZEND_ACC_*_SET + zend_object_handlers.c write guard — Zend raises Error: Cannot modify ... and the read path is unaffected.
Notes
Done when
🤖 Generated with Claude Code
Summary
On current master (4c4c300), AOT binaries mis-compile classes using PHP 8.4 asymmetric property visibility. A
public private(set) intproperty read returns garbage (uninitialized slot) and the set-visibility guard never raises, so program output diverges from VM/JIT.script/capability-syntax.phpregeneration in the pinned container now honestly flips the row to AOT=no (synced in the capability doc-sync PR).Repro
bin/vm.php2+caught: Cannot modify public private(set) property C::$x from global scope./phpc build+ run (AOT)446409552(garbage int, no caught line)Environment: php-compiler:22.04-dev (PHP 8.2.31, LLVM 9),
PHP_COMPILER_LLVM_PATH=/opt/llvm9.php-src reference
Zend/zend_compile.c
ZEND_ACC_*_SET+ zend_object_handlers.c write guard — Zend raisesError: Cannot modify ...and the read path is unaffected.Notes
Done when
2, guard Error caught)php script/capability-syntax.php --checkgreen with the row back at AOT=yes🤖 Generated with Claude Code