Category
language · php-src-strict
Problem
On PHP 8.4 property hooks, isset($obj->hooked) must use Zend's isset-style backing probe and must not call the get hook. This compiler invokes the get hook, so virtual/write-only properties with throwing getters fatal instead of returning false.
Distinct from #5203 (get_object_vars() must call get hooks) and from #8732 (json_encode get-hook rule).
Related closed issues that did not cover isset() specifically: #8901 (empty()), #8902 (??).
php-src reference
Repro
Save as test/repro/issue_property_hook_isset.php:
<?php
class C {
public ?string $x {
get { throw new Exception('get must not run for isset'); }
}
}
$c = new C();
var_dump(isset($c->x));
echo "ok\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro/issue_property_hook_isset.php
php bin/vm.php test/repro/issue_property_hook_isset.php
'
| Runtime |
Expected |
Observed (2026-06-16) |
| Zend 8.4+ |
bool(false) + ok |
— |
| VM |
same |
Fatal: get must not run for isset |
Scope (this repo)
| Area |
Files |
| VM |
lib/VM.php — issetPropertyHookProbe() / opcode OP_ISSET on hooked props |
| JIT |
lib/JIT/PropertyHookDispatch.php — mirror isset probe without get-hook call |
| Tests |
test/compliance/cases/language/property_hook_isset.phpt |
PHP-in-PHP first — no new runtime/*.c branches.
Done when
Links
Category
language· php-src-strictProblem
On PHP 8.4 property hooks,
isset($obj->hooked)must use Zend's isset-style backing probe and must not call the get hook. This compiler invokes the get hook, so virtual/write-only properties with throwing getters fatal instead of returningfalse.Distinct from #5203 (
get_object_vars()must call get hooks) and from #8732 (json_encodeget-hook rule).Related closed issues that did not cover
isset()specifically: #8901 (empty()), #8902 (??).php-src reference
Zend/zend_property_hooks.c—zend_isset_property_exZend/zend_operators.c—issetopcode on hooked propertiesRepro
Save as
test/repro/issue_property_hook_isset.php:bool(false)+okget must not run for issetScope (this repo)
lib/VM.php—issetPropertyHookProbe()/ opcodeOP_ISSETon hooked propslib/JIT/PropertyHookDispatch.php— mirror isset probe without get-hook calltest/compliance/cases/language/property_hook_isset.phptPHP-in-PHP first — no new
runtime/*.cbranches.Done when
bool(false)andokon VM (JIT/AOT when property-hook lowering is in scope)isset($obj->hooked)on virtual/uninitialized hooked propertiesisset()still returnstruewhen separate backing is initialized (php-src-strict)Links