3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<html> <h1 background="blue"><em>Another form</em></h1> <form align="center" method="Post" action="<?php htmlspecialchars($_SERVER["php_self"]);?>"> First Name:<input type="text" name="name1"><br> Last Name :<input type="text" name="name2"><br> Age :<input type="integer" List="age" name="age"> <datalist id="age"> <option value="1">18</option> <option value="2">19</option> <option value="3">20</option> <option value="4">21</option> </datalist><br> Country:<input type="text" list="country" name="country"> <datalist option= "country"> <option id="mylist"> <option value="Angola"> <option value="ARgentina"> <option value="Afghanistan"> <option value="Armenia"> <option value="Benin"> <option value="Bruei"> <option value="Belgium"> <option value="Cameroun"> <option value="Congo DR"> <option value="Denmark"> <option value="Estonia"> <option value="Eritrea"> </datalist><br> E-mail:<input type="text" name="email"><br> Password:<input type="password"><br> Sex<br><input type="radio" name="sex" value="Male" checked="checked" >Male <input type="radio" name="sex" value="Female">Female<br> comment<textarea name="comment" rows="6" columns="250" background="#f7f7f7">your comment here</textarea> <input type="submit" value="SUBMIT"> <?php if(isset($_POST["SUBMIT"])){ echo "your name is " .$name." you are wlcome"; } //define variables and set to empty values $first_name= $last_name= $age= $country =$email= $password = $sex = $comment; if( $_SERVER[REQUEST_METHOD]=="POST"){ $first_name= test_input($_POST["name1"]); $last_name= test_input($_POST["name2"]); $age= test_input($_POST["age"]); $country= test_input($_POST["country"]); $email= test_input($_POST["email"]); $password+ test_input($_POST["password"]); $sex= test_input($_POST["sex"]); $comment= test_input($_POST["comment"]); } function test_input($data){ $data= trim($data); $data= striplash($data); $data= htmlspecialchars($data); return $data; } ?> </html>
Output for 5.3.0 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
<html> <h1 background="blue"><em>Another form</em></h1> <form align="center" method="Post" action=" Notice: Undefined index: php_self in /in/GDr03 on line 3 "> First Name:<input type="text" name="name1"><br> Last Name :<input type="text" name="name2"><br> Age :<input type="integer" List="age" name="age"> <datalist id="age"> <option value="1">18</option> <option value="2">19</option> <option value="3">20</option> <option value="4">21</option> </datalist><br> Country:<input type="text" list="country" name="country"> <datalist option= "country"> <option id="mylist"> <option value="Angola"> <option value="ARgentina"> <option value="Afghanistan"> <option value="Armenia"> <option value="Benin"> <option value="Bruei"> <option value="Belgium"> <option value="Cameroun"> <option value="Congo DR"> <option value="Denmark"> <option value="Estonia"> <option value="Eritrea"> </datalist><br> E-mail:<input type="text" name="email"><br> Password:<input type="password"><br> Sex<br><input type="radio" name="sex" value="Male" checked="checked" >Male <input type="radio" name="sex" value="Female">Female<br> comment<textarea name="comment" rows="6" columns="250" background="#f7f7f7">your comment here</textarea> <input type="submit" value="SUBMIT"> Notice: Undefined variable: comment in /in/GDr03 on line 39 Notice: Use of undefined constant REQUEST_METHOD - assumed 'REQUEST_METHOD' in /in/GDr03 on line 40 Notice: Undefined index: REQUEST_METHOD in /in/GDr03 on line 40 </html>
Output for hhvm-3.12.0
<html> <h1 background="blue"><em>Another form</em></h1> <form align="center" method="Post" action=" Notice: Undefined index: php_self in /in/GDr03 on line -1 "> First Name:<input type="text" name="name1"><br> Last Name :<input type="text" name="name2"><br> Age :<input type="integer" List="age" name="age"> <datalist id="age"> <option value="1">18</option> <option value="2">19</option> <option value="3">20</option> <option value="4">21</option> </datalist><br> Country:<input type="text" list="country" name="country"> <datalist option= "country"> <option id="mylist"> <option value="Angola"> <option value="ARgentina"> <option value="Afghanistan"> <option value="Armenia"> <option value="Benin"> <option value="Bruei"> <option value="Belgium"> <option value="Cameroun"> <option value="Congo DR"> <option value="Denmark"> <option value="Estonia"> <option value="Eritrea"> </datalist><br> E-mail:<input type="text" name="email"><br> Password:<input type="password"><br> Sex<br><input type="radio" name="sex" value="Male" checked="checked" >Male <input type="radio" name="sex" value="Female">Female<br> comment<textarea name="comment" rows="6" columns="250" background="#f7f7f7">your comment here</textarea> <input type="submit" value="SUBMIT"> Notice: Undefined variable: comment in /in/GDr03 on line -1 Notice: Use of undefined constant REQUEST_METHOD - assumed 'REQUEST_METHOD' in /in/GDr03 on line -1 Notice: Undefined index: REQUEST_METHOD in /in/GDr03 on line -1 </html>
Output for 5.0.4 - 5.2.17
<html> <h1 background="blue"><em>Another form</em></h1> <form align="center" method="Post" action=" Notice: Undefined index: php_self in /in/GDr03 on line 3 "> First Name:<input type="text" name="name1"><br> Last Name :<input type="text" name="name2"><br> Age :<input type="integer" List="age" name="age"> <datalist id="age"> <option value="1">18</option> <option value="2">19</option> <option value="3">20</option> <option value="4">21</option> </datalist><br> Country:<input type="text" list="country" name="country"> <datalist option= "country"> <option id="mylist"> <option value="Angola"> <option value="ARgentina"> <option value="Afghanistan"> <option value="Armenia"> <option value="Benin"> <option value="Bruei"> <option value="Belgium"> <option value="Cameroun"> <option value="Congo DR"> <option value="Denmark"> <option value="Estonia"> <option value="Eritrea"> </datalist><br> E-mail:<input type="text" name="email"><br> Password:<input type="password"><br> Sex<br><input type="radio" name="sex" value="Male" checked="checked" >Male <input type="radio" name="sex" value="Female">Female<br> comment<textarea name="comment" rows="6" columns="250" background="#f7f7f7">your comment here</textarea> <input type="submit" value="SUBMIT"> Notice: Undefined variable: comment in /in/GDr03 on line 39 Notice: Use of undefined constant REQUEST_METHOD - assumed 'REQUEST_METHOD' in /in/GDr03 on line 40 Notice: Undefined index: REQUEST_METHOD in /in/GDr03 on line 40 </html>
Output for 4.3.0 - 5.0.3
<html> <h1 background="blue"><em>Another form</em></h1> <form align="center" method="Post" action=" Notice: Undefined index: php_self in /in/GDr03 on line 3 "> First Name:<input type="text" name="name1"><br> Last Name :<input type="text" name="name2"><br> Age :<input type="integer" List="age" name="age"> <datalist id="age"> <option value="1">18</option> <option value="2">19</option> <option value="3">20</option> <option value="4">21</option> </datalist><br> Country:<input type="text" list="country" name="country"> <datalist option= "country"> <option id="mylist"> <option value="Angola"> <option value="ARgentina"> <option value="Afghanistan"> <option value="Armenia"> <option value="Benin"> <option value="Bruei"> <option value="Belgium"> <option value="Cameroun"> <option value="Congo DR"> <option value="Denmark"> <option value="Estonia"> <option value="Eritrea"> </datalist><br> E-mail:<input type="text" name="email"><br> Password:<input type="password"><br> Sex<br><input type="radio" name="sex" value="Male" checked="checked" >Male <input type="radio" name="sex" value="Female">Female<br> comment<textarea name="comment" rows="6" columns="250" background="#f7f7f7">your comment here</textarea> <input type="submit" value="SUBMIT"> Notice: Undefined variable: comment in /in/GDr03 on line 39 Notice: Use of undefined constant REQUEST_METHOD - assumed 'REQUEST_METHOD' in /in/GDr03 on line 40 Notice: Undefined index: REQUEST_METHOD in /in/GDr03 on line 40 </html>