Closed
Description
Description
The following code:
<?php
namespace Foo;
class Bar
{
public static function testClass(): \Closure
{
return function(){};
}
}
function testFunc(): \Closure
{
return function(){};
}
var_dump((new \ReflectionFunction(Bar::testClass()))->getNamespaceName());
var_dump((new \ReflectionFunction(testFunc()))->getNamespaceName());
Resulted in this output:
string(12) "{closure:Foo"
string(12) "{closure:Foo"
But I expected this output instead:
string(3) "Foo"
string(3) "Foo"
PHP Version
PHP 8.4.0RC1
Operating System
No response