3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = 5; $y = 10; function myTest() { $y = $x + $y; } myTest(); // run function echo $y; // output the new value for variable $y ?>
based on qZiG5
Output for 7.0.0 - 7.2.11
Notice: Undefined variable: x in /in/dSdVe on line 7 Notice: Undefined variable: y in /in/dSdVe on line 7 10
Output for hhvm-3.22.0
Notice: Undefined variable: y in /in/dSdVe on line -1 Notice: Undefined variable: x in /in/dSdVe on line -1 10
Output for 5.3.22 - 5.6.38, hhvm-3.11.1 - 3.21.3
Notice: Undefined variable: y in /in/dSdVe on line 7 Notice: Undefined variable: x in /in/dSdVe on line 7 10