Category
language
Problem
public private(set) T $prop is enforced on VM (#3165) but JIT either skips the guard or surfaces a non-catchable LogicException instead of Zend’s Error, so scripts using try/catch (Error) diverge.
Capability: docs/capabilities-syntax.md — asymmetric visibility JIT: no.
php-src reference
Repro
<?php
class User {
public private(set) string $name = 'a';
}
$u = new User();
try {
$u->name = 'b';
echo "no error\n";
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh \
&& php bin/vm.php test/repro-maintainer/asymmetric_set.php \
&& php bin/jit.php test/repro-maintainer/asymmetric_set.php'
| Mode |
Behavior |
| Zend |
catchable Error: Cannot modify private(set) property User::$name from global scope |
| VM |
message printed (fatal path) |
| JIT |
uncaught LogicException (not catchable as Error) |
Maintainer repro: test/repro-maintainer/asymmetric_set.php
Compliance exists: test/compliance/cases/language/asymmetric_visibility.phpt (VM-only gate in JITTest.php).
Scope
lib/JIT/ property write guards (mirror VM asymmetric set visibility)
- Throw
Error (not LogicException) to match Zend
- Enable JIT compliance row for
asymmetric_visibility*.phpt
Done when
Links
Category
languageProblem
public private(set) T $propis enforced on VM (#3165) but JIT either skips the guard or surfaces a non-catchableLogicExceptioninstead of Zend’sError, so scripts usingtry/catch (Error)diverge.Capability:
docs/capabilities-syntax.md— asymmetric visibility JIT: no.php-src reference
Zend/zend_compile.c—ZEND_ACC_PRIVATE_SETZend/zend_object_handlers.c—zend_check_property_accessRepro
Error:Cannot modify private(set) property User::$name from global scopeLogicException(not catchable asError)Maintainer repro:
test/repro-maintainer/asymmetric_set.phpCompliance exists:
test/compliance/cases/language/asymmetric_visibility.phpt(VM-only gate inJITTest.php).Scope
lib/JIT/property write guards (mirror VM asymmetric set visibility)Error(notLogicException) to match Zendasymmetric_visibility*.phptDone when
catch (Error)JITTestno longer skipsasymmetric_visibilityJIT cases./script/ci-fast.sh --filter asymmetric_visibilitygreenLinks