php-8.0.30-src/Zend/tests/call_user_func_closure_from...

23 lines
389 B
PHP

--TEST--
call_user_func() on non-static closure without $this inside a static method
--FILE--
<?php
class A {
public static function exec(callable $c) {
return call_user_func($c);
}
public static function doSomething() {
return self::exec(function(){
return "okay";
});
}
}
var_dump(A::doSomething());
?>
--EXPECT--
string(4) "okay"