3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class x { function z() { static x = 2; return x++; } } $x = new x; var_dump($x->z()); var_dump($x->z()); var_dump($x->z());
Output for 5.4.0 - 5.4.12
Parse error: syntax error, unexpected 'x' (T_STRING), expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /in/h74vS on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.22
Parse error: syntax error, unexpected T_STRING, expecting T_PAAMAYIM_NEKUDOTAYIM in /in/h74vS on line 6
Process exited with code 255.