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 '\nstring name blee'; return 'blee'; } if ($flag == 3){ echo '\nnew object blee'; return new blee; } } } class blee { static $baz = "\nOh, baz!"; } /**********************************/ $foo = "bla"; echo $foo::bar()::$baz; $foo = new bla; echo $foo::bar()::$baz;
based on oODIi
Output for 7.0.0 - 7.2.0
\nstring name blee Oh, baz!\nnew object blee Oh, baz!
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM), expecting ',' or ';' in /in/k2Z08 on line 24
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ',' or ';' in /in/k2Z08 on line 24
Process exited with code 255.