3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = 5; // global scope function myTest() { echo "Variable x inside function is: $x"; } myTest(); echo "Variable x outside function is: $x"; ?> ?>
Output for 5.6.30, hhvm-3.15.4 - 3.21.3, 7.0.0 - 7.3.0rc3
Notice: Undefined variable: x in /in/nZ84k on line 5 Variable x inside function is: Variable x outside function is: 5 ?>
Output for hhvm-3.22.0
Notice: Undefined variable: x in /in/nZ84k on line -1 Variable x inside function is: Variable x outside function is: 5 ?>