Category
Regression · php-src-strict · Error message wording (Pillar 4)
Problem
Writing a public private(set) property from outside scope correctly throws Error, but the message diverges from Zend 8.4.23:
| Repro |
Zend 8.4.23 |
VM PROFILE=8.4 |
$a->x = 2 on public private(set) string $x |
Cannot modify private(set) property A::$x from global scope |
Cannot modify public private(set) property A::$x from global scope ❌ |
Unit fixtures currently expect a third wording (public (private(set))), so tests and Zend both disagree with live VM — align to Zend.
Probed 2026-07-20 vs php:8.4-cli (8.4.23).
php-src reference
PHP implementation target
- Match Zend message text in asymmetric set guards (VM + JIT/AOT); update unit expectations in
test/unit/AsymmetricVisibilityJitExecuteTest.php / related; PHP-in-PHP; no new C.
Repro
./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4
php bin/vm.php -r "
class A { public private(set) string \$x = \"a\"; }
\$a = new A();
try { \$a->x = \"b\"; } catch (Throwable \$e) { echo \$e->getMessage(), PHP_EOL; }
"
# expect: Cannot modify private(set) property A::\$x from global scope
'
Done when
Related
Category
Regression· php-src-strict · Error message wording (Pillar 4)Problem
Writing a
public private(set)property from outside scope correctly throwsError, but the message diverges from Zend 8.4.23:$a->x = 2onpublic private(set) string $xCannot modify private(set) property A::$x from global scopeCannot modify public private(set) property A::$x from global scope❌Unit fixtures currently expect a third wording (
public (private(set))), so tests and Zend both disagree with live VM — align to Zend.Probed 2026-07-20 vs
php:8.4-cli(8.4.23).php-src reference
Zend/zend_object_handlers.c— asymmetric set guard / error messageZend/zend_compile.c— asymmetric visibilityPHP implementation target
test/unit/AsymmetricVisibilityJitExecuteTest.php/ related; PHP-in-PHP; no new C.Repro
Done when
Related
#15995·#18820·#9842