Skip to content

new ReflectionClass('Closure') throws "Class Closure does not exist". #198

Closed

Description

@blacktrs

Summary

new ReflectionClass('Closure') throws "Class Closure does not exist".

Repro

<?php
$r = new ReflectionClass('Closure');
var_dump($r->getName(), $r->isFinal());
var_dump((new ReflectionClass(fn() => 1))->getName());

Expected (php)

string(7) "Closure"
bool(true)
string(7) "Closure"

Actual (manticore 1423cd65, Darwin arm64)


[exit code 255]
PHP Fatal error:  Uncaught ReflectionException: Class "Closure" does not exist

Tracking

Known-bug repro: tests/aot/repro/wrong/reflection_class_closure_does_not_exist.php — bash tests/aot/xfail.sh -k reflection_class_closure_does_not_exist reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

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

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions