3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $y1 = ~-$x * 4; # ?identical to $y2 = ($x-1)*4; $y2 = ($x-1)*4; var_dump($y1,$y2);
Output for 5.2.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: x in /in/ISJ85 on line 2 Notice: Undefined variable: x in /in/ISJ85 on line 3 int(-4) int(-4)
Output for 5.0.4 - 5.2.2
Notice: Undefined variable: x in /in/ISJ85 on line 2 Notice: Undefined variable: x in /in/ISJ85 on line 3 int(-1) int(-4)
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: x in /in/ISJ85 on line 2 Notice: Undefined variable: x in /in/ISJ85 on line 3 int(-1) int(-4)