Skip to content

Stdlib: PropertyHookType enum — PHP 8.4 property hook reflection enum missing (php_reflection.stub.php, pairs #7295) #7323

@PurHur

Description

@PurHur

Summary

PHP 8.4 adds PropertyHookType unit enum (Get, Set) used by ReflectionProperty::getHooks() return map keys. Issue #7295 tracks the reflection methods; they cannot be implemented correctly without registering this builtin enum.

php-src reference

Repro

./script/docker-exec.sh -- php bin/vm.php test/repro-maintainer/property_hook_type_enum.php

Current: bool(false) for class_exists('PropertyHookType')

Expected (Zend PHP 8.4+): enum registered; PropertyHookType::Get->name === 'Get'

Implementation (PHP-in-PHP)

  1. Register PropertyHookType unit enum in ext/standard/BuiltinEnums.php (referenced as pattern in Stdlib: ExitStatus enum — PHP 8.4 exit()/die() backed enum missing (basic_functions.stub.php) #7294 issue body).
  2. Use enum cases as keys when implementing Stdlib: ReflectionProperty::isVirtual()/isDynamic()/getHooks() — PHP 8.4 property hook reflection missing (php_reflection.c) #7295 ReflectionProperty::getHooks().
  3. Compliance .phpt for enum existence + reflection map key types.

Done when

Links

#7295 · #7294 · #1492

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language featuresphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions