Skip to content

Language: drop isAnonymousClass() free-function phantom (#28616) - #28736

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-28616-isanonymousclass-phantom
Aug 7, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-28616-isanonymousclass-phantom

Conversation

@PurHur

@PurHur PurHur commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Free-function isAnonymousClass() is absent from php-src; only ReflectionClass::isAnonymous() / ReflectionFunction::isAnonymous() exist.
  • CompilerVersion::supportsIsAnonymousClass() / advertisesIsAnonymousClass() now always return false on php-src-strict profiles (including PROFILE=8.4/8.5), so ext/reflection no longer registers the free function.
  • php-src: ext/reflection/php_reflection.stub.php. PHP: lib/CompilerVersion.php + ext/reflection/Module.php gate.

Closes #28616

Test plan

  • PHP_COMPILER_PROFILE=8.4|8.5|8.2 php bin/vm.php test/repro/issue_28616_isanonymousclass_phantom.php → ok: isAnonymousClass withheld; ReflectionClass::isAnonymous works
  • PHP_COMPILER_PROFILE=8.4|8.5 php bin/jit.php -r 'var_export(function_exists("isAnonymousClass")); echo "\n";' → false
  • ./script/phpunit.sh test/compliance/IsAnonymousClassPhantomVMTest.php → OK
  • ./script/phpunit.sh test/compliance/IsAnonymousClassPhantomJITTest.php → OK
  • ./script/phpunit.sh --filter 'Issue28616IsAnonymousClassPhantomTest|testIsAnonymousClassNeverAdvertisedOnForwardProfile|testLazyObjectFactoriesEnabledOnForwardProfile' → OK (3 tests, 54 assertions)

Gate snapshot (pre-claim / master)

  • docker info: ok
  • ./script/release-readiness.sh --json: user_release_ready: yes (north-star5-fast ok; gen-0 provenance stale warning only)

Not covered

  • JIT ReflectionClass::isAnonymous() on anonymous classes still segfaults on this host (pre-existing; out of scope — free-function retirement only). VM path verified.

Made with Cursor

php-src only ships ReflectionClass::isAnonymous(); stop registering and
advertising the free function on every php-src-strict profile.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit e370f95 into master Aug 7, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-28616-isanonymousclass-phantom branch August 7, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: isAnonymousClass() phantom on PROFILE≥8.4 — Zend ReflectionClass::isAnonymous only (ext/reflection/php_reflection.stub.php)

1 participant