Skip to content

Regression: ReflectionConstant getFileName/getDocComment/getExtension* still missing on PROFILE=8.4 (re-#23894, ext/reflection) #28692

Closed as not planned

Description

@PurHur

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 implementation target

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

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 Aug 7, 2026
  2. PurHur commented on Aug 7, 2026

    @PurHur
    OwnerAuthor

    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)
  3. PurHur commented on Aug 7, 2026

    @PurHur
    OwnerAuthor

    Not a regression — VM already matches php-src (php-src-strict)

    Claimed this run (Worker Lane A). Reproduced the described method_exists inventory under PHP_COMPILER_PROFILE=8.4 / 8.5, then compared against php-src stubs:

    API PHP-8.4.x stub PHP-8.5.0 stub master VM PROFILE=8.4 VM PROFILE=8.5
    getFileName / getExtension / getExtensionName absent present present N Y
    getAttributes absent present present N Y
    getDocComment / getStartLine / getEndLine never on ReflectionConstant never never N N
    inNamespace absent absent present (8.6+) N N

    php-src refs:

    Repo 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 ReflectionClassConstant or with 8.5 APIs.

    Gate snapshot: inventory OK 7215/7215; release-readiness --json → user_release_ready: yes.

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