3v4l.org

run code in 300+ PHP versions simultaneously
<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 git.master, git.master_jit, rfc.property-hooks
<html> <h1 background="blue"><em>Another form</em></h1> <form align="center" method="Post" action=" Warning: Undefined array key "php_self" in /in/GDr03 on line 3 Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated 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"> Warning: Undefined variable $comment in /in/GDr03 on line 39 Fatal error: Uncaught Error: Undefined constant "REQUEST_METHOD" in /in/GDr03:40 Stack trace: #0 {main} thrown in /in/GDr03 on line 40
Process exited with code 255.

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:
47.22 ms | 403 KiB | 8 Q