3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php?> <form name="input" action="index.php" method="get"> Type in a number:<input type="text" name="xnumber"> <input type="submit" value="Submit"> </form> <?php function calculate($x, $y) { $newnum = $x * $y; return $newnum; } $multiply = $_GET["xnumber"]; echo "The new number is " . calculate($num, $multiply); $num = calculate($num, $multiply); ?>
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Use of undefined constant php - assumed 'php' in /in/ceIuo on line 1 <form name="input" action="index.php" method="get"> Type in a number:<input type="text" name="xnumber"> <input type="submit" value="Submit"> </form> Notice: Undefined index: xnumber in /in/ceIuo on line 14 Notice: Undefined variable: num in /in/ceIuo on line 15 The new number is 0 Notice: Undefined variable: num in /in/ceIuo on line 16
Output for hhvm-3.10.0 - 3.12.0
Fatal error: <?php directive must be followed by whitespace, newline, or EOF (Line: 1, Char: 5) syntax error, unexpected T_HH_ERROR, expecting $end in /in/ceIuo on line 1
Process exited with code 255.
Output for 5.3.0 - 5.3.29
<?php?> <form name="input" action="index.php" method="get"> Type in a number:<input type="text" name="xnumber"> <input type="submit" value="Submit"> </form> Notice: Undefined index: xnumber in /in/ceIuo on line 14 Notice: Undefined variable: num in /in/ceIuo on line 15 The new number is 0 Notice: Undefined variable: num in /in/ceIuo on line 16
Output for 5.0.4 - 5.2.17
<?php?> <form name="input" action="index.php" method="get"> Type in a number:<input type="text" name="xnumber"> <input type="submit" value="Submit"> </form> Notice: Undefined index: xnumber in /in/ceIuo on line 14 Notice: Undefined variable: num in /in/ceIuo on line 15 The new number is 0 Notice: Undefined variable: num in /in/ceIuo on line 16
Output for 4.3.0 - 5.0.3
<?php?> <form name="input" action="index.php" method="get"> Type in a number:<input type="text" name="xnumber"> <input type="submit" value="Submit"> </form> Notice: Undefined index: xnumber in /in/ceIuo on line 14 Notice: Undefined variable: num in /in/ceIuo on line 15 The new number is 0 Notice: Undefined variable: num in /in/ceIuo on line 16