mirror of
https://github.com/php/php-src.git
synced 2024-09-24 03:17:26 +00:00
8f9f21e8d2
I'm assuming this is the only error that is_callable() can generate with retval=1. This problem manifested after making closures in static methods not implicitly static, but would also occur when binding any non-static closure to a scope without a $this.
23 lines
389 B
PHP
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"
|