1
0
mirror of https://github.com/php/php-src.git synced 2026-04-08 00:22:52 +02:00
Files
archived-php-src/Zend/tests/bug66719.phpt
Nikita Popov dfd05da97f Fix bug #66719
While parent:: should inherit the called scope, it should only do
so if it is compatible. If there is no called scope, or it is not
a subtype of the scope, we should fall back to the scope.
2021-07-23 11:24:22 +02:00

44 lines
677 B
PHP

--TEST--
Bug #66719: Weird behaviour when using get_called_class() with call_user_func()
--FILE--
<?php
class A
{
public static function who()
{
var_dump(get_called_class());
}
}
class B extends A
{
public static function who()
{
parent::who();
}
}
class C
{
public static function test() {
B::who();
call_user_func(array(A::class, 'who'));
call_user_func(array(B::class, 'parent::who'));
}
}
B::who();
call_user_func(array(A::class, 'who'));
call_user_func(array(B::class, 'parent::who'));
C::test();
?>
--EXPECT--
string(1) "B"
string(1) "A"
string(1) "A"
string(1) "B"
string(1) "A"
string(1) "A"