mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Set called_scope in __callStatic closure trampoline
This commit is contained in:
parent
338a47bb85
commit
a8926474cb
2 changed files with 11 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue