3v4l.org

run code in 300+ PHP versions simultaneously
Calculator <form action = "calculator.php" method = "post"> <table> <table width="300" height="200" border="20"> <tr><td>first number: </tr><td><input type="text" name="num1"><br></td><tr> <tr><td>0perattor: </tr><td><input type="text" name="oper"><br></td><tr> <tr><td>second number: </tr><td><input type="text" name="num2"><br></td><tr> </tr><td></tr><td><input type="submit" value="solve"></td><tr> </table> </form> <?php $num1=$_POST['num1']; $num2=$_POST['num2']; $oper=$_POST['oper']; if($oper=='+'){ $result= $num1+$num2 ; echo "The Sum is $result"; }else if($oper=='-'){ $result= $num1-$num2; echo "The Difference is $result"; }else if($oper=='*'){ $result= $num1*$num2 ; echo "The Product is $result"; }else if($oper=='/'){ $result= $num1/$num2 ; echo "The Quotient is $result"; }else echo" Operator doest not exist" ?>
Output for git.master, git.master_jit, rfc.property-hooks
Calculator <form action = "calculator.php" method = "post"> <table> <table width="300" height="200" border="20"> <tr><td>first number: </tr><td><input type="text" name="num1"><br></td><tr> <tr><td>0perattor: </tr><td><input type="text" name="oper"><br></td><tr> <tr><td>second number: </tr><td><input type="text" name="num2"><br></td><tr> </tr><td></tr><td><input type="submit" value="solve"></td><tr> </table> </form> Warning: Undefined array key "num1" in /in/kioMj on line 17 Warning: Undefined array key "num2" in /in/kioMj on line 18 Warning: Undefined array key "oper" in /in/kioMj on line 19 Operator doest not exist

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
52.6 ms | 402 KiB | 8 Q