Return to forward_static_call_003.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / class_object |
1.1 misho 1: --TEST-- 2: forward_static_call() calling outside of the inheritance chain. 3: --FILE-- 4: <?php 5: 6: class A 7: { 8: const NAME = 'A'; 9: public static function test() { 10: echo static::NAME, "\n"; 11: } 12: } 13: 14: class B extends A 15: { 16: const NAME = 'B'; 17: 18: public static function test() { 19: echo self::NAME, "\n"; 20: forward_static_call(array('parent', 'test')); 21: } 22: } 23: 24: class C 25: { 26: const NAME = 'C'; 27: 28: public static function test() { 29: echo self::NAME, "\n"; 30: forward_static_call(array('B', 'test')); 31: } 32: } 33: 34: A::test(); 35: echo "-\n"; 36: B::test(); 37: echo "-\n"; 38: C::test(); 39: 40: ?> 41: ===DONE=== 42: --EXPECTF-- 43: A 44: - 45: B 46: B 47: - 48: C 49: B 50: B 51: ===DONE===