3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class A { static $i=1; static function B() { echo self::$i."\n"; echo __CLASS__; } } class B extends A { static $i=2; static function B(){ echo self::$i."\t".__CLASS__; } B::B();
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected 'B' (T_STRING), expecting function (T_FUNCTION) in /in/g1T9Y on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in /in/g1T9Y on line 16
Process exited with code 255.

preferences:
172.92 ms | 1399 KiB | 61 Q