mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Set called_scope in __callStatic closure trampoline
This commit is contained in:
@@ -8,19 +8,25 @@ class Foo {
|
||||
}
|
||||
|
||||
public static function __callStatic($method, $args) {
|
||||
return $method;
|
||||
return static::class . "::" . $method;
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo {}
|
||||
|
||||
$foo = new Foo;
|
||||
$bar = $foo->anythingInstance(...);
|
||||
|
||||
echo $bar() . PHP_EOL;
|
||||
echo $bar(), "\n";
|
||||
|
||||
$qux = Foo::anythingStatic(...);
|
||||
echo $qux(), "\n";
|
||||
|
||||
$qux2 = Bar::anythingStatic(...);
|
||||
echo $qux2(), "\n";
|
||||
|
||||
echo $qux();
|
||||
?>
|
||||
--EXPECT--
|
||||
anythingInstance
|
||||
anythingStatic
|
||||
Foo::anythingStatic
|
||||
Bar::anythingStatic
|
||||
|
||||
@@ -282,6 +282,7 @@ static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ {
|
||||
}
|
||||
|
||||
fcc.object = fci.object = Z_OBJ_P(ZEND_THIS);
|
||||
fcc.called_scope = zend_get_called_scope(EG(current_execute_data));
|
||||
|
||||
zend_call_function(&fci, &fcc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user