3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<!DOCTYPE html> <html> <body> <?php $t; function myCalculations () { $x=22; echo "<p>Test variable oustide of function:</p>"; echo "variable x is: $x"; echo "<br>"; echo "variable t is: $t"; }// Code will only display x myCalculations(); echo "<p>Test variable inside of function:</p>"; echo "variable x is: $x"; echo "<br>"; echo "variable t is: $t"; ?>//Code will only display t </body> </html>
Output for 5.1.0 - 7.1.0
<!DOCTYPE html> <html> <body> <p>Test variable oustide of function:</p>variable x is: 22<br> Notice: Undefined variable: t in /in/Q3FVV on line 11 variable t is: <p>Test variable inside of function:</p> Notice: Undefined variable: x in /in/Q3FVV on line 15 variable x is: <br> Notice: Undefined variable: t in /in/Q3FVV on line 17 variable t is: //Code will only display t </body> </html>
Output for 5.0.4 - 5.0.5
<!DOCTYPE html> <html> <body> Notice: Undefined variable: t in /in/Q3FVV on line 5 <p>Test variable oustide of function:</p>variable x is: 22<br> Notice: Undefined variable: t in /in/Q3FVV on line 11 variable t is: <p>Test variable inside of function:</p> Notice: Undefined variable: x in /in/Q3FVV on line 15 variable x is: <br> Notice: Undefined variable: t in /in/Q3FVV on line 17 variable t is: //Code will only display t </body> </html>
Output for 4.3.0 - 5.0.3
<!DOCTYPE html> <html> <body> Notice: Undefined variable: t in /in/Q3FVV on line 5 <p>Test variable oustide of function:</p>variable x is: 22<br> Notice: Undefined variable: t in /in/Q3FVV on line 11 variable t is: <p>Test variable inside of function:</p> Notice: Undefined variable: x in /in/Q3FVV on line 15 variable x is: <br> Notice: Undefined variable: t in /in/Q3FVV on line 17 variable t is: //Code will only display t </body> </html>