Category
stdlib · php-src-strict
Problem
get_class() on an enum case must return the enum class name (e.g. "E"). Issue filed when VM returned false.
Maintainer re-probe (2026-06-06): VM now returns string(1) "E" — matches Zend on php bin/vm.php -r 'enum E { case A; } var_dump(get_class(E::A));'. Remaining work is to lock parity in compliance tests and verify JIT/AOT paths (if they bypass get_class() VM handler).
php-src reference
Related: #4260 (get_debug_type() on enum cases) — separate builtin, same enum-case object path.
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "enum E { case A; } var_dump(get_class(E::A));"
php -r "enum E { case A; } var_dump(get_class(E::A));"
php bin/jit.php -r "enum E { case A; } var_dump(get_class(E::A));" 2>&1
'
| Check |
Zend |
VM (2026-06-06) |
JIT |
get_class(E::A) |
"E" |
"E" ✓ |
verify |
get_class($object) plain object |
class name |
unchanged |
verify |
get_class() no args in method scope |
$this class |
unchanged |
verify |
Add test/repro/parity_get_class_enum.php (or move from test/repro-maintainer/ if present).
Scope (this repo)
| Path |
Work |
ext/standard/get_class_.php |
Confirm enum-case branch |
ext/standard/VmReflection.php |
Enum case class-id resolution |
lib/JIT/Builtin/ |
JIT lowering if missing |
test/compliance/cases/stdlib/get_class_enum.phpt |
VM + JIT + AOT |
Done when
Category
stdlib· php-src-strictProblem
get_class()on an enum case must return the enum class name (e.g."E"). Issue filed when VM returnedfalse.Maintainer re-probe (2026-06-06): VM now returns
string(1) "E"— matches Zend onphp bin/vm.php -r 'enum E { case A; } var_dump(get_class(E::A));'. Remaining work is to lock parity in compliance tests and verify JIT/AOT paths (if they bypassget_class()VM handler).php-src reference
ext/standard/basic_functions.c—zif_get_class()enum branchZend/zend_enum.c— enum object class nameRelated: #4260 (
get_debug_type()on enum cases) — separate builtin, same enum-case object path.Repro
get_class(E::A)"E""E"✓get_class($object)plain objectget_class()no args in method scope$thisclassAdd
test/repro/parity_get_class_enum.php(or move fromtest/repro-maintainer/if present).Scope (this repo)
ext/standard/get_class_.phpext/standard/VmReflection.phplib/JIT/Builtin/test/compliance/cases/stdlib/get_class_enum.phptDone when
.phptgreen on VM, JIT, AOTget_class()with no args / two args edge cases on enum cases unchanged vs Zend