3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = 4; // this line might result in unexpected output: echo "x minus one equals " . $x-1 . ", or so I hope\n"; // because it is evaluated like this line: echo (("x minus one equals " . $x) - 1) . ", or so I hope\n"; // the desired precendence can be enforced by using parentheses: echo "x minus one equals " . ($x-1) . ", or so I hope\n";
based on ENSR5
Output for 7.1.0 - 7.2.8
Warning: A non-numeric value encountered in /in/hQhOu on line 4 -1, or so I hope Warning: A non-numeric value encountered in /in/hQhOu on line 6 -1, or so I hope x minus one equals 3, or so I hope
Output for 5.6.0 - 5.6.30, hhvm-3.15.4 - 3.22.0, 7.0.0 - 7.0.31
-1, or so I hope -1, or so I hope x minus one equals 3, or so I hope