3v4l.org

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