- var_dump: documentation ( source)
<?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());