Repository navigation
Regression: ReflectionConstant getFileName/getDocComment/getExtension* still missing on PROFILE=8.4 (re-#23894, ext/reflection) #28692
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
area:vmVirtual machineVirtual machinebugSomething isn't workingSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web appsstdlib
Description
Category
Stdlib · php-src-strict · PROFILE≥8.4 · regression (re-#23894 / re-#22662 / re-#22421)
Problem
Under PHP_COMPILER_PROFILE=8.4, ReflectionConstant still lacks several Zend methods that were previously filed and closed. getName / getValue / getNamespaceName / getShortName / isDeprecated / __toString are present; file/extension/doc metadata APIs are not.
Verified 2026-08-07 on master @45744edb07 (VM) inside ./script/docker-exec.sh.
| Method | Zend 8.4+ ReflectionConstant |
VM PROFILE=8.4 (2026-08-07) |
|---|---|---|
getFileName() |
string|false |
missing (method_exists false) |
getStartLine() / getEndLine() |
int|false |
missing |
getDocComment() |
string|false |
missing |
getExtension() / getExtensionName() |
?ReflectionExtension / string|false |
missing |
getName() / getValue() |
present | present (OK) |
PHP Fatal error: Uncaught Error: Call to undefined method ReflectionConstant::getFileName()
php-src reference
- php/php-src
ext/reflection/php_reflection.stub.php—class ReflectionConstant - php/php-src
ext/reflection/php_reflection.c—ReflectionConstanthandlers
PHP implementation target
ext/reflectionPHP implementation ofReflectionConstant— add missing methods; wire to constant declaration metadata already available to the compiler- No new C in
runtime/ - Prior closes: Regression: ReflectionConstant getFileName/getExtension*/getDocComment/inNamespace still missing on PROFILE=8.4 (re-#22662, ext/reflection) #23894, Regression: ReflectionConstant getFileName/getExtension*/getDocComment/inNamespace still missing on PROFILE=8.4 (re-#22421, ext/reflection) #22662, Stdlib: ReflectionConstant getFileName/getExtension*/getDocComment missing on 8.4 (re-#21551, ext/reflection/php_reflection.c) #22421, Stdlib: ReflectionConstant missing getNamespaceName/getShortName/inNamespace/getFileName/__toString (ext/reflection/php_reflection.c) #21551 — behavior has regressed again
Repro
./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/rc_file.php'<?php
const C = 42;
$r = new ReflectionConstant('C');
foreach (['getName','getValue','getFileName','getStartLine','getEndLine','getDocComment','getExtension','getExtensionName'] as $m) {
echo $m, '=', method_exists($r, $m) ? 'Y' : 'N', "\n";
}
echo $r->getFileName(), "\n";Done when
- Under PROFILE≥8.4 (and 8.5), listed methods exist and match Zend return types/values for user constants
-
method_exists/ ReflectionMethod inventory matches php-src stubs for this class (no phantoms of 8.5-only APIs on 8.4 — see closed Regression: ReflectionConstant::getAttributes() phantom on PROFILE≤8.4 — Zend 8.5-only (ext/reflection/php_reflection.stub.php) #28157) - Compliance
.phptundertest/compliance/cases/reflection/ - php-src-strict; no php-compiler-strict shortcut
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:vmVirtual machineVirtual machinebugSomething isn't workingSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web appsstdlib
Activity
PurHur commentedon Aug 7, 2026
claim: Worker Lane A — starting this run
Gate snapshot before claim:
php script/bootstrap-inventory.php --check→ OK 7215/7215./script/release-readiness.sh --json→user_release_ready: yes(north-star5-fast ok; gen-0 provenance stale warning only)PurHur commentedon Aug 7, 2026
Not a regression — VM already matches php-src (php-src-strict)
Claimed this run (Worker Lane A). Reproduced the described
method_existsinventory underPHP_COMPILER_PROFILE=8.4/8.5, then compared against php-src stubs:getFileName/getExtension/getExtensionNamegetAttributesgetDocComment/getStartLine/getEndLineReflectionConstantinNamespacephp-src refs:
ReflectionConstanthas only__construct/getName/getNamespaceName/getShortName/getValue/isDeprecated/__toStringgetAttributesRepo already encodes this via
CompilerVersion::advertisesReflectionConstantFileExtensionApis()(8.5+) and compliance:test/compliance/cases/reflection/reflection_constant_file_ext_doc_phantom_84.phpt(expects absent on 8.4)test/compliance/cases/reflection/reflection_constant_file_extension_85.phpt(expects present on 8.5)Advertising these on PROFILE=8.4 would create phantoms vs Zend 8.4 (re-#22662). Closing as not a defect — likely confused with
ReflectionClassConstantor with 8.5 APIs.Gate snapshot: inventory OK 7215/7215;
release-readiness --json→user_release_ready: yes.