xref: /PHP-5.5/Zend/tests/lsb_021.phpt (revision feb85801)
1--TEST--
2ZE2 Late Static Binding parent::/self:: forwarding while classname doesn't
3--FILE--
4<?php
5class A {
6    public static function test() {
7        echo get_called_class()."\n";
8    }
9}
10
11class B extends A {
12    public static function testForward() {
13        parent::test();
14        call_user_func("parent::test");
15        call_user_func(array("parent", "test"));
16        self::test();
17        call_user_func("self::test");
18        call_user_func(array("self", "test"));
19    }
20    public static function testNoForward() {
21        A::test();
22        call_user_func("A::test");
23        call_user_func(array("A", "test"));
24        B::test();
25        call_user_func("B::test");
26        call_user_func(array("B", "test"));
27    }
28}
29
30class C extends B {
31
32}
33
34C::testForward();
35C::testNoForward();
36
37?>
38--EXPECTF--
39C
40C
41C
42C
43C
44C
45A
46A
47A
48B
49B
50B
51