1--TEST-- 2forward_static_call() called from outside of a method. 3--FILE-- 4<?php 5 6class A 7{ 8 const NAME = 'A'; 9 public static function test() { 10 echo static::NAME, "\n"; 11 } 12} 13 14class 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 public static function test2() { 24 echo self::NAME, "\n"; 25 forward_static_call(array('self', 'test')); 26 } 27 28 public static function test3() { 29 echo self::NAME, "\n"; 30 forward_static_call(array('A', 'test')); 31 } 32} 33 34class C extends B 35{ 36 const NAME = 'C'; 37 38 public static function test() 39 { 40 echo self::NAME, "\n"; 41 forward_static_call(array('A', 'test')); 42 } 43} 44 45A::test(); 46echo "-\n"; 47B::test(); 48echo "-\n"; 49B::test2(); 50echo "-\n"; 51B::test3(); 52echo "-\n"; 53C::test(); 54echo "-\n"; 55C::test2(); 56echo "-\n"; 57C::test3(); 58 59?> 60--EXPECT-- 61A 62- 63B 64B 65- 66B 67B 68B 69- 70B 71B 72- 73C 74C 75- 76B 77B 78C 79- 80B 81C 82