3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function myTest(){ static $x=0; echo "$x"; $x++; } myTest(); echo "$x++"; myTest(); echo "$x++"; myTest(); ?>
Output for 5.6.30, hhvm-3.15.4 - 3.21.3, 7.0.0 - 7.2.9
0 Notice: Undefined variable: x in /in/FcIq3 on line 8 ++1 Notice: Undefined variable: x in /in/FcIq3 on line 10 ++2
Output for hhvm-3.22.0
0 Notice: Undefined variable: x in /in/FcIq3 on line -1 ++1 Notice: Undefined variable: x in /in/FcIq3 on line -1 ++2