3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function foo() { $f = function() { echo get_called_class()."\n"; echo static::$bar."\n"; }; $f(); echo get_called_class()."\n"; echo static::$bar."\n"; } } class B extends A { static public $bar = 'ss'; } B::foo(); echo get_called_class():"\n";
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.25
Parse error: syntax error, unexpected ':', expecting ',' or ';' in /in/SVtLr on line 21
Process exited with code 255.

preferences:
183.85 ms | 1395 KiB | 62 Q