3v4l.org

run code in 300+ PHP versions simultaneously
<?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());

preferences:
58.9 ms | 404 KiB | 5 Q