3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> </head> <body> <form method ="POST" action ="tag.php"> Fruit name : <input type ="text" name="fruit"/> <br> Price/KG<input type="text" name="price"/> <br> <input type="submit" value="submit the price" name="submit1"/> </form> <?php $fru =$_POST['fruit']; $cost =$_POST['price']; echo "the fruit is $fru and its price is $cost"; ?> </body> </html>
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
<html> <head> </head> <body> <form method ="POST" action ="tag.php"> Fruit name : <input type ="text" name="fruit"/> <br> Price/KG<input type="text" name="price"/> <br> <input type="submit" value="submit the price" name="submit1"/> </form> Warning: Undefined array key "fruit" in /in/THSXb on line 18 Warning: Undefined array key "price" in /in/THSXb on line 20 the fruit is and its price is </body> </html>

preferences:
56.74 ms | 407 KiB | 5 Q