Category
language · php-src-strict (PHP 8.4)
Problem
PHP 8.4 adds static property hooks (public static int $n { get => ...; set => ...; }). This compiler parses and runs a subset (see test/repro/issue_4807_static_property_hook_jit.php), but behavior is unverified vs php-src 8.4 and JIT/AOT paths are missing. Zend 8.2 in harness correctly rejects the syntax; parity target is php-src master 8.4 semantics.
php-src reference
Repro
In-tree: test/repro/issue_4807_static_property_hook_jit.php
<?php
class Counter {
public static int $n {
get => self::$n;
set => self::$n = $value * 2;
}
}
Counter::$n = 3;
echo Counter::$n, "\n";
# Compare against php-src 8.4+ build when available; interim VM audit:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/issue_4807_static_property_hook_jit.php
php bin/jit.php test/repro/issue_4807_static_property_hook_jit.php 2>&1 | head -5
'
| Step |
Expected (php-src 8.4) |
VM today |
Counter::$n = 3 |
set hook runs ($value * 2 → stores 6) |
prints 6 on VM (audit set hook) |
| JIT |
same as VM |
verify / file gap |
Scope (this repo)
| Path |
Work |
lib/Compiler.php |
Static hooked property metadata + read/write lowering |
lib/VM/PropertyHookSupport.php |
Static get/set dispatch (mirror instance hooks #4687) |
lib/JIT/ |
Hook calls on static property access (or explicit VM-only deferral) |
| Tests |
test/compliance/cases/language/static_property_hooks.phpt |
PHP-in-PHP: hook bodies compiled through existing pipeline; no new runtime/*.c.
Done when
Related: instance hooks #4687, #6427, Reflection raw access #6451. Ref: #1492
Category
language· php-src-strict (PHP 8.4)Problem
PHP 8.4 adds static property hooks (
public static int $n { get => ...; set => ...; }). This compiler parses and runs a subset (seetest/repro/issue_4807_static_property_hook_jit.php), but behavior is unverified vs php-src 8.4 and JIT/AOT paths are missing. Zend 8.2 in harness correctly rejects the syntax; parity target is php-src master 8.4 semantics.php-src reference
Zend/zend_property_hooks.c— static hook handlers, backing storageZend/zend_compile.c— static hooked property declaration ASTZend/tests/property_hooks/property_hooks_static*.phpt(php-src 8.4+)Repro
In-tree:
test/repro/issue_4807_static_property_hook_jit.phpCounter::$n = 3$value * 2→ stores 6)6on VM (audit set hook)Scope (this repo)
lib/Compiler.phplib/VM/PropertyHookSupport.phplib/JIT/test/compliance/cases/language/static_property_hooks.phptPHP-in-PHP: hook bodies compiled through existing pipeline; no new
runtime/*.c.Done when
6)unset/inheritance/typed-static edge cases from php-src tests covered or linked as follow-ups./script/ci-fast.sh --filter static_property_hooksgreenRelated: instance hooks #4687, #6427, Reflection raw access #6451. Ref: #1492