xref: /PHP-8.4/Zend/tests/bug66719.phpt (revision ee510eed)
1--TEST--
2Bug #66719: Weird behaviour when using get_called_class() with call_user_func()
3--FILE--
4<?php
5
6class A
7{
8    public static function who()
9    {
10        var_dump(get_called_class());
11    }
12}
13class B extends A
14{
15    public static function who()
16    {
17        parent::who();
18    }
19}
20
21class C
22{
23    public static function test() {
24        B::who();
25        call_user_func(array(A::class, 'who'));
26        call_user_func(array(B::class, 'parent::who'));
27    }
28}
29
30B::who();
31call_user_func(array(A::class, 'who'));
32call_user_func(array(B::class, 'parent::who'));
33
34C::test();
35
36?>
37--EXPECTF--
38string(1) "B"
39string(1) "A"
40
41Deprecated: Callables of the form ["B", "parent::who"] are deprecated in %s on line %d
42string(1) "A"
43string(1) "B"
44string(1) "A"
45
46Deprecated: Callables of the form ["B", "parent::who"] are deprecated in %s on line %d
47string(1) "A"
48