php-src/ext/reflection/tests/bug75186.phpt
2019-05-09 12:33:53 +02:00

26 lines
492 B
PHP

--TEST--
Bug #75186: Inconsistent reflection of Closure:::__invoke()
--FILE--
<?php
$rc = new ReflectionClass(Closure::class);
foreach ($rc->getMethods() as $method) {
if ($method->name == '__invoke') {
var_dump($method);
$method->invoke(
function($what) { echo "Hello $what!\n"; },
"World"
);
}
}
?>
--EXPECTF--
object(ReflectionMethod)#%d (2) {
["name"]=>
string(8) "__invoke"
["class"]=>
string(7) "Closure"
}
Hello World!