Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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