3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> <title>Personal INFO</title> </head> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> First Name:<input type="text" size="12" maxlength="12" name="Fname"><br /> Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender"><br /> Female:<input type="radio" value="Female" name="gender"><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]"><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]"><br /> Chicken:<input type="checkbox" value="Chicken" name="food[]"><br /> <textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option></select><br /> Select your favorite time of day:<br /> <select name="TofD" size="3"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option></select><br /> <input type="submit" value="submit" name="submit"> </form> <?php $Fname = $_POST['Fname']; $Lname = $_POST['Lname']; $gender = $_POST['gender']; $food = $_POST['food']; $quote = $_POST['quote']; $education = $_POST['education']; $TofD = $_POST['TofD']; if(isset($_POST['submit'])) { $name = $_POST['name']; echo 'User Has submitted the form and entered this name : '; echo $name; echo 'You can use the following form again to enter a new name.'; } else { echo 'Hello, '; echo $Fname; echo $Lname; echo 'You are '; echo $gender; echo 'and you like '; foreach ($food as $f) { echo $f; } echo $quote; echo 'Youre favorite time is '; echo $TofD; echo 'and you passed '; echo $education; } ?> </body> </html>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
<html> <head> <title>Personal INFO</title> </head> <body> <form method="post" action="/in/KklhQ"> First Name:<input type="text" size="12" maxlength="12" name="Fname"><br /> Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender"><br /> Female:<input type="radio" value="Female" name="gender"><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]"><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]"><br /> Chicken:<input type="checkbox" value="Chicken" name="food[]"><br /> <textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option></select><br /> Select your favorite time of day:<br /> <select name="TofD" size="3"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option></select><br /> <input type="submit" value="submit" name="submit"> </form> Warning: Undefined array key "Fname" in /in/KklhQ on line 30 Warning: Undefined array key "Lname" in /in/KklhQ on line 31 Warning: Undefined array key "gender" in /in/KklhQ on line 32 Warning: Undefined array key "food" in /in/KklhQ on line 33 Warning: Undefined array key "quote" in /in/KklhQ on line 34 Warning: Undefined array key "education" in /in/KklhQ on line 35 Warning: Undefined array key "TofD" in /in/KklhQ on line 36 Hello, You are and you like Warning: foreach() argument must be of type array|object, null given in /in/KklhQ on line 52 Youre favorite time is and you passed </body> </html>
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
<html> <head> <title>Personal INFO</title> </head> <body> <form method="post" action="/in/KklhQ"> First Name:<input type="text" size="12" maxlength="12" name="Fname"><br /> Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender"><br /> Female:<input type="radio" value="Female" name="gender"><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]"><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]"><br /> Chicken:<input type="checkbox" value="Chicken" name="food[]"><br /> <textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option></select><br /> Select your favorite time of day:<br /> <select name="TofD" size="3"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option></select><br /> <input type="submit" value="submit" name="submit"> </form> Notice: Undefined index: Fname in /in/KklhQ on line 30 Notice: Undefined index: Lname in /in/KklhQ on line 31 Notice: Undefined index: gender in /in/KklhQ on line 32 Notice: Undefined index: food in /in/KklhQ on line 33 Notice: Undefined index: quote in /in/KklhQ on line 34 Notice: Undefined index: education in /in/KklhQ on line 35 Notice: Undefined index: TofD in /in/KklhQ on line 36 Hello, You are and you like Warning: Invalid argument supplied for foreach() in /in/KklhQ on line 52 Youre favorite time is and you passed </body> </html>
Output for 7.3.32 - 7.3.33, 7.4.26
<html> <head> <title>Personal INFO</title> </head> <body> <form method="post" action="/in/KklhQ"> First Name:<input type="text" size="12" maxlength="12" name="Fname"><br /> Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender"><br /> Female:<input type="radio" value="Female" name="gender"><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]"><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]"><br /> Chicken:<input type="checkbox" value="Chicken" name="food[]"><br /> <textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option></select><br /> Select your favorite time of day:<br /> <select name="TofD" size="3"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option></select><br /> <input type="submit" value="submit" name="submit"> </form> Hello, You are and you like Warning: Invalid argument supplied for foreach() in /in/KklhQ on line 52 Youre favorite time is and you passed </body> </html>
Output for 5.2.3 - 5.2.17
<html> <head> <title>Personal INFO</title> </head> <body> <form method="post" action="/in/KklhQ"> First Name:<input type="text" size="12" maxlength="12" name="Fname"><br /> Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender"><br /> Female:<input type="radio" value="Female" name="gender"><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]"><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]"><br /> Chicken:<input type="checkbox" value="Chicken" name="food[]"><br /> <textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option></select><br /> Select your favorite time of day:<br /> <select name="TofD" size="3"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option></select><br /> <input type="submit" value="submit" name="submit"> </form> Notice: Undefined index: Fname in /in/KklhQ on line 30 Notice: Undefined index: Lname in /in/KklhQ on line 31 Notice: Undefined index: gender in /in/KklhQ on line 32 Notice: Undefined index: food in /in/KklhQ on line 33 Notice: Undefined index: quote in /in/KklhQ on line 34 Notice: Undefined index: education in /in/KklhQ on line 35 Notice: Undefined index: TofD in /in/KklhQ on line 36 Hello, You are and you like Warning: Invalid argument supplied for foreach() in /in/KklhQ on line 52 Youre favorite time is and you passed </body> </html>
Output for 4.3.0 - 4.3.10, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<html> <head> <title>Personal INFO</title> </head> <body> <form method="post" action=""> First Name:<input type="text" size="12" maxlength="12" name="Fname"><br /> Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender"><br /> Female:<input type="radio" value="Female" name="gender"><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]"><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]"><br /> Chicken:<input type="checkbox" value="Chicken" name="food[]"><br /> <textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option></select><br /> Select your favorite time of day:<br /> <select name="TofD" size="3"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option></select><br /> <input type="submit" value="submit" name="submit"> </form> Notice: Undefined index: Fname in /in/KklhQ on line 30 Notice: Undefined index: Lname in /in/KklhQ on line 31 Notice: Undefined index: gender in /in/KklhQ on line 32 Notice: Undefined index: food in /in/KklhQ on line 33 Notice: Undefined index: quote in /in/KklhQ on line 34 Notice: Undefined index: education in /in/KklhQ on line 35 Notice: Undefined index: TofD in /in/KklhQ on line 36 Hello, You are and you like Warning: Invalid argument supplied for foreach() in /in/KklhQ on line 52 Youre favorite time is and you passed </body> </html>
Output for 4.3.11
<html> <head> <title>Personal INFO</title> </head> <body> <form method="post" action=""> First Name:<input type="text" size="12" maxlength="12" name="Fname"><br /> Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender"><br /> Female:<input type="radio" value="Female" name="gender"><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]"><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]"><br /> Chicken:<input type="checkbox" value="Chicken" name="food[]"><br /> <textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option></select><br /> Select your favorite time of day:<br /> <select name="TofD" size="3"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option></select><br /> <input type="submit" value="submit" name="submit"> </form> Notice: Undefined index: Fname in /in/KklhQ on line 30 Notice: Undefined index: Lname in /in/KklhQ on line 31 Notice: Undefined index: gender in /in/KklhQ on line 32 Notice: Undefined index: food in /in/KklhQ on line 33 Notice: Undefined index: quote in /in/KklhQ on line 34 Notice: Undefined index: education in /in/KklhQ on line 35 Notice: Undefined index: TofD in /in/KklhQ on line 36 Hello, You are and you like Youre favorite time is and you passed </body> </html>

preferences:
266.64 ms | 405 KiB | 352 Q