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===DONE=== 61--EXPECTF-- 62A 63- 64B 65B 66- 67B 68B 69B 70- 71B 72B 73- 74C 75C 76- 77B 78B 79C 80- 81B 82C 83===DONE=== 84