Annotation of embedaddon/php/Zend/tests/lsb_021.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: ZE2 Late Static Binding parent::/self:: forwarding while classname doesn't
                      3: --FILE--
                      4: <?php
                      5: class A {
                      6:     public static function test() {
                      7:         echo get_called_class()."\n";
                      8:     }
                      9: }
                     10: 
                     11: class 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: 
                     30: class C extends B {
                     31: 
                     32: }
                     33: 
                     34: C::testForward();
                     35: C::testNoForward();
                     36: 
                     37: ?>
                     38: --EXPECTF--
                     39: C
                     40: C
                     41: C
                     42: C
                     43: C
                     44: C
                     45: A
                     46: A
                     47: A
                     48: B
                     49: B
                     50: B

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>