3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { const NAME = 'A'; public static function test() { $args = func_get_args( ); echo static::NAME, " ".join(',', $args)." \n"; } } class B extends A { const NAME = 'B'; public static function test() { echo self::NAME, "\n"; forward_static_call(array('A', 'test'),'more', 'args'); forward_static_call( 'test', 'other', 'args'); } } function test() { $args = func_get_args(); echo "C ".join(',', $args)." \n"; } B::test(); function test() { $args = func_get_args(); echo "C ".join(',', $args)." \n"; } ?>
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.19
Fatal error: Cannot redeclare test() (previously declared in /in/2PIEd:23) in /in/2PIEd on line 32
Process exited with code 255.

preferences:
171.87 ms | 1395 KiB | 55 Q