3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $inc = 2; recv(5); function recv($v) { global $inc; if ($v >= 1) { echo $inc * $v . " "; $v--; $s = $s + $inc * $v; recv($v); } } echo "The sum is $s"; ?>
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
10 Notice: Undefined variable: s in /in/WkgQL on line 12 8 Notice: Undefined variable: s in /in/WkgQL on line 12 6 Notice: Undefined variable: s in /in/WkgQL on line 12 4 Notice: Undefined variable: s in /in/WkgQL on line 12 2 Notice: Undefined variable: s in /in/WkgQL on line 12 Notice: Undefined variable: s in /in/WkgQL on line 23 The sum is
Output for 4.3.0 - 5.0.3
10 Notice: Undefined variable: s in /in/WkgQL on line 12 8 Notice: Undefined variable: s in /in/WkgQL on line 12 6 Notice: Undefined variable: s in /in/WkgQL on line 12 4 Notice: Undefined variable: s in /in/WkgQL on line 12 2 Notice: Undefined variable: s in /in/WkgQL on line 12 Notice: Undefined variable: s in /in/WkgQL on line 23 The sum is