3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class bla { static function bar(){ static $flag = 1; $flag++; if ($flag == 2 ) { echo 'string name blee',"\n"; return 'blee'; } if ($flag == 3){ echo 'new object blee',"\n"; return new blee; } } } class blee { static $baz = "\nOh, baz!"; } /**********************************/ $foo = "bla"; echo $foo::bar()::$baz; $foo = new bla; echo $foo::bar()::$baz;
based on OtR32
Output for 7.0.0 - 7.2.0
string name blee Oh, baz!new object blee Oh, baz!
Output for 5.5.0 - 5.6.28
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM), expecting ',' or ';' in /in/oODIi on line 24
Process exited with code 255.