Skip to content

ReflectionFunction::getNamespaceName() is still broken for closures in PHP 8.4 #18070

Closed as not planned
@jlherren

Description

@jlherren

Description

The following code:

<?php
namespace TestNamespace;
$ref = new \ReflectionFunction(function (Other\Factory $factory) {
});
echo $ref->getNamespaceName(), "\n";

Resulted in this output:


But I expected this output instead (as output by PHP 8.1, 8.2 and 8.3):

TestNamespace

Also see possibly related #16122.

PHP Version

PHP 8.4.5

Operating System

Official docker image php:8.4-cli

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions