Skip to content

Stdlib: Reflection class missing — Reflection::getModifierNames() (ext/reflection/php_reflection.c) #22127

Closed

Description

@PurHur

Category

stdlib · php-src-strict

Problem

Zend exposes the internal Reflection base class with static helpers such as Reflection::getModifierNames(). php-compiler registers ReflectionClass and related types but not Reflection, so class_exists('Reflection') is false and calls fatal.

Repro Zend 8.2+ VM (2026-07-22)
Reflection::getModifierNames(17) ["public","static"] Class "Reflection" not found

php-src reference

PHP implementation target

  • lib/VM/BuiltinClasses.php / ext/standard/VmReflection.php — register Reflection with getModifierNames(int $modifiers): array mapping modifier bits to names (reuse VmReflection bit constants already used for getModifiers()).
  • Wire VM (and JIT stubs if reflection builtins are shared) without new C runtime logic.

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_reflection_get_modifier_names.php'

Done when

  • class_exists('Reflection') true; Reflection::getModifierNames() matches Zend for public/private/protected/static/abstract/final/readonly combinations
  • Compliance guard under test/compliance/cases/reflection/
  • php-src-strict; VM/JIT agree where reflection is JIT-backed

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 22, 2026
  2. PurHur commented on Jul 22, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (issues #22127, #22108, #22145, #22064, #22144; sequential PRs, merge before next)

    Starting #22127: Reflection::getModifierNames() + register Reflection base class (php-src-strict).

  3. PurHur commented on Jul 22, 2026

    @PurHur
    OwnerAuthor

    merged: #22153

    Verification

    • Zend + VM repro test/repro/maintainer_reflection_get_modifier_names.php: 17=["public","static"] … OK
    • phpunit --filter reflection_get_modifier_names: OK (2 tests, VM+JIT)
    • bootstrap-inventory --check: OK 6359/6359
    • check-generated-docs.sh: OK

    Next in batch: #22108 ReflectionClass::getTraits()

  4. PurHur commented on Jul 22, 2026

    @PurHur
    OwnerAuthor

    merged: #22153 (squash after rebase onto master)

    Verification (post-rebase)

    • VM repro: 17=["public","static"] … OK
    • phpunit --filter reflection_get_modifier_names: OK (2 tests, VM+JIT)
    • inventory: OK 6362/6362

    Next in batch: #22108 ReflectionClass::getTraits()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions