3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php include("connect.php"); include("functions.php"); // define variables and set to empty values $nameErr = $sexErr = $designationErr = $departmentErr = $instituteErr = $staeErr = $countryErr = $mobilenoErr = $officenoErr = $residencenoErr = $email = ""; $name = $sex = $designation = $department = $institute = $state = $country = $mobileno = $officeno = $residenceno = $email = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) { $nameErr = "Name is required"; } else { $name = test_input($_POST["name"]); } if (empty($_POST["sex"])) { $genderErr = "Gender is required"; }else { $gender = test_input($_POST["sex"]); } } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["designation"])) { $designationErr = "required"; }else { $designation = test_input($_POST["designation"]); } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["department"])) { $departmentErr = "required"; }else { $department = test_input($_POST["department"]); } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["institute"])) { $instituteeErr = "required"; }else { $institute = test_input($_POST["institute"]); } if (empty($_POST["city"])) { $city = ""; }else { $city = test_input($_POST["city"]); } if (empty($_POST["state"])) { $stateErr = "required"; }else { $state = test_input($_POST["state"]); } if (empty($_POST["country"])) { $countryErr = "required"; }else { $country = test_input($_POST["country"]); } if (empty($_POST["pincode"])) { $pincode = ""; }else { $pincode = test_input($_POST["pincode"]); } if (empty($_POST["OfficeNo"])) { $OfficeNo = ""; }else { $OfficeNo = test_input($_POST["officeNo"]); } if (empty($_POST["residenceNo"])) { $residenceNo = ""; }else { $residenceNo = test_input($_POST["ResidenceNo"]); } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["MobileNo"])) { $MobileNoErr = "required"; }else { $MobileNo = test_input($_POST["MobileNo"]); } if (empty($_POST["email"])) { $emailErr = "Email is required"; }else { $email = test_input($_POST["email"]); // check if e-mail address is well-formed if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailErr = "Invalid email format"; } } $insertQuery = "INSERT INTO Personal_info(userName, sex, designation, department, institute, city, state, country, pin_code, office_no., residence_no., mobile_no., email_id.) VALUES ('$name', '$sex', '$designation', '$department', '$institute','$city', '$state', '$country', '$pincode', '$officeno', '$residenceno', '$mobileno', '$email')"; if(mysqli_query($con, $insertQuery)) { echo "New record created successfully"; } else { echo "not register"; } } } } } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?> <!doctype html> <html> <head> <title>Registration Form</title> </head> <body bgcolor="#FFFFFF"> <form name="name" action="" onsubmit="return validate_form();" method="post"> <table align="center" width=40% width="100%" cellspacing="2" cellpadding="2" border="5"> <tr> <td colspan="7" align="center"><b>Employee Registration Form.</b></td> </tr> <tr> <td align="left" valign="top" width="30%">Name<span style="color:red">*</span></td> <td width="57%"><select name="mydropdown"> <option value="Default">Default</option> <option value="Professor">Professor</option> <option value="Doctor">Doctor</option> <option value="Mr">Mr</option> <option value="Miss">Miss</option> <option value="Mrs">Mrs</option> </select> <td width="57%"><input type="text" value="" name="name" size="30"></td> </tr></td> <tr> <td align="left" valign="top" width="41%">Sex<span style="color:red">*</span></td> <td width="57%"> <input type="text" value="" name="sex" onkeypress="return isNumberKey(event)" size="24"></td> </tr> <tr> <td align="left" valign="top" width="41%">Designation<span style="color:red">*</span></td> <td width="57%"> <input type="text" value="" name="designation" onkeypress="return isNumberKey(event)" size="24"></td> </tr> <tr> <td align="left" valign="top" width="41%">Department<span style="color:red">*</span></td> <td width="57%"> <input type="text" value="" name="department" onkeypress="return isNumberKey(event)" size="24"></td> </tr> <tr> <td align="left" valign="top" width="41%">Institute<span style="color:red">*</span></td> <td width="57%"> <input type="text" value="" name="institute" onkeypress="return isNumberKey(event)" size="24"></td> </tr> <!--<tr> <td align="left" valign="top" width="41%">Employee Number<span style="color:red">*</span></td> <td width="57%"> <input type="text" value="" name="num" onkeypress="return isNumberKey(event)" size="24"></td> </tr>--> <tr> <td align="left" valign="top" width="41%">City</td> <td width="57%"><textarea rows="1" maxlen="100" name="city" cols="20"></textarea></td> <td align="left" valign="top" width="41%">State</td> <td width="57%"><textarea rows="1" maxlen="100" name="state" cols="20"></textarea></td> <tr> <td align="left" valign="top" width="41%">Country</td> <td width="57%"><textarea rows="1" maxlen="100" name="country" cols="20"></textarea></td> <td align="left" valign="top" width="41%">Pincode</td> <td width="57%"><textarea rows="1" maxlen="100" name="pincode" cols="20"></textarea></td> </tr> </tr> <tr> <td align="left" valign="top" width="41%">OfficeNo.</td> <td width="57%"> <input type="text" value="" onkeypress="return isNumberKey(event)" name="officeno" size="24"></td> <td align="left" valign="top" width="41%">ResidenceNo.</td> <td width="57%"> <input type="text" value="" onkeypress="return isNumberKey(event)" name="residenceno" size="24"></td> </tr> <tr> <td align="left" valign="top" width="41%">MobileNo.</td> <td width="57%"> <input type="text" value="" onkeypress="return isNumberKey(event)" name="mobileno" size="24"></td> </tr> <!--<td align="left" valign="top" width="41%">Designation:</td> <td width="57%"> <input type="text" value="" onkeypress="return isNumberKey(event)" name="txtFName1" size="24"></td> </tr> <tr> <td align="left" valign="top" width="41%">Job Location</td> <td width="57%"><select name="mydropdown"> <option value="Default">Default</option> <option value="Chennai">Chennai</option> <option value="Bangalore">Bangalore</option> <option value="Chennai">Pune</option> <option value="Bangalore">Mysore</option> <option value="Chennai">Chandigarh</option> </select></td> </tr> <tr> <td align="left" valign="top" width="41%">Designation</td> <td width="57%"> <select name="mydropdown"> <option value="Default">Default</option> <option value="Systems Engineer">Systems Engineer</option> <option value="Senior Systems Engineer">Senior Systems Engineer</option> <option value="Technology Analyst">Technology Analyst</option> <option value="Technology Lead">Technology Lead</option> <option value="Project Manager">Project Manager</option> </select></td> </tr>--> <tr> <td align="left" valign="top" width="41%">email<span style="color:red">*</span></td> <td width="57%"> <input type="text" value="" name="email" size="24"></td> </tr> <tr> <td colspan="2"> <p align="center"> <input type="submit" value=" Submit" name="B4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value=" Reset All " name="B5"></td> <a href="step2.php" style="float:right; padding:10px; margin-right:40px; background-color:#eee; color:#333; text-decoration:none;">Next</a> </tr> </table> </form> </body> </html>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.1.70.0060.01016.90
7.1.60.0230.01735.18
7.1.50.0200.01834.81
7.1.40.0130.02334.18
7.1.30.0210.01534.35
7.1.20.0170.01334.52
7.1.10.0070.01116.29
7.1.00.0070.00916.38
7.0.200.0050.01316.75
7.0.190.0010.01816.67
7.0.180.0090.00915.96
7.0.170.0080.00816.09
7.0.160.0090.00916.30
7.0.150.0030.01316.15
7.0.140.0030.01416.06
7.0.130.0030.01516.24
7.0.120.0120.00816.22
7.0.110.0100.00616.09
7.0.100.0060.00816.02
7.0.90.0030.01315.98
7.0.80.0060.00916.21
7.0.70.0090.01016.07
7.0.60.0080.01016.08
7.0.50.0080.01015.94
7.0.40.0030.01316.34
7.0.30.0050.01216.38
7.0.20.0050.01216.19
7.0.10.0080.00816.20
7.0.00.0060.01216.27

preferences:
140.45 ms | 1394 KiB | 7 Q