3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<html> <body> <?php $x=5; // global scope function myTest() { $y=10; // local scope echo "<p>Test variables inside the function:</p>"; echo "Variable x is: $x"; echo "<br>"; echo "Variable y is: $y"; } myTest(); echo "<p>Test variables outside the function:</p>"; echo "Variable x is: $x"; echo "<br>"; echo "Variable y is: $y"; ?> </body> </html>
Output for 5.0.4 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
<html> <body> <p>Test variables inside the function:</p> Notice: Undefined variable: x in /in/bDRBG on line 10 Variable x is: <br>Variable y is: 10<p>Test variables outside the function:</p>Variable x is: 5<br> Notice: Undefined variable: y in /in/bDRBG on line 20 Variable y is: </body> </html>
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.0.3
<html> <body> <p>Test variables inside the function:</p> Notice: Undefined variable: x in /in/bDRBG on line 10 Variable x is: <br>Variable y is: 10<p>Test variables outside the function:</p>Variable x is: 5<br> Notice: Undefined variable: y in /in/bDRBG on line 20 Variable y is: </body> </html>