Skip to content

Regression: ReflectionProperty getRawValue/setRawValue/getMangledName/isDefaultValueAvailable phantoms (re-#6451/#11442, ext/reflection) #22601

Description

@PurHur

Category

bug · php-src-strict · stdlib · reflection · VERSION_ID / profile gate (pillar 4)

Problem

Several ReflectionProperty methods diverge from Zend/php-src:

  1. getRawValue / setRawValue — PHP 8.4 APIs (property hooks bypass). VM advertises them under default / PROFILE=8.2 where Zend 8.2 has neither. Prior closed add: Stdlib: ReflectionProperty::setRawValue()/getRawValue() — bypass hooks for init (PHP 8.4, ext/reflection/php_reflection.c) #6451.
  2. getMangledNamenot a php-src ReflectionProperty method on any current branch; VM invents it and returns the short name.
  3. isDefaultValueAvailable — php-src puts this on ReflectionParameter, not ReflectionProperty (property side uses hasDefaultValue()). Prior related: Stdlib: ReflectionProperty::hasDefaultValue() / isDefaultValueAvailable() missing (ext/reflection/php_reflection.c) #11442 (hasDefaultValue). VM advertises the parameter API name on properties.

Verified 2026-07-23 (Zend 8.2.32 vs VM):

Repro Zend 8.2 VM (default / 8.2 / 8.4)
method_exists(…, 'getRawValue') 0 1
method_exists(…, 'setRawValue') 0 1
method_exists(…, 'getMangledName') 0 1
method_exists(…, 'isDefaultValueAvailable') 0 1
method_exists(…, 'hasDefaultValue') 1 1 (ok)

On PROFILE=8.4, getRawValue/setRawValue may remain (php-src 8.4+); getMangledName and isDefaultValueAvailable must stay absent.

php-src reference

PHP implementation target

  • ext/reflection/ method table — remove getMangledName / isDefaultValueAvailable always; gate getRawValue/setRawValue on 8.4 profile
  • Prefer PHP-in-PHP; no new runtime/*.c

Repro

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.2 php bin/vm.php test/repro/reflectionproperty_phantoms.php'
# compare: php test/repro/reflectionproperty_phantoms.php

Done when

  • On default / PROFILE=8.2: getRawValue/setRawValue/getMangledName/isDefaultValueAvailable all method_exists false
  • On any profile: getMangledName and isDefaultValueAvailable remain undefined on ReflectionProperty
  • On PROFILE=8.4: getRawValue/setRawValue match php-src 8.4; hasDefaultValue unchanged
  • Compliance guard; php-src-strict

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