3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "lkintrea@yahoo.com"; $email_subject = "Your email subject line"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['first_last']) || !isset($_POST['office_phone']) || !isset($_POST['cell']) || !isset($_POST['email']) || !isset($_POST['company']) || !isset($_POST['comments'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $first_last = $_POST['first_last']; // required $office_phone = $_POST['office_phone']; // required $cell = $_POST['cell']; // required $email = $_POST['email']; // not required $email = $_POST['company']; // not required $comments = $_POST['comments']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$office_phone)) { $error_message .= 'The First Name you entered does not appear to be valid.<br />'; } if(!preg_match($string_exp,$last_first)) { $error_message .= 'The Last Name you entered does not appear to be valid.<br />'; } if(strlen($comments) < 2) { $error_message .= 'The Comments you entered do not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Last Name: ".clean_string($first_last)."\n"; $email_message .= "Office Phone: ".clean_string($office_phone)."\n"; $email_message .= "Cell: ".clean_string($cell)."\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Company: ".clean_string($company)."\n"; $email_message .= "Comments: ".clean_string($comments)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <!-- include your own success html here --> Thank you for contacting us. We will be in touch with you very soon. <?php } ?>

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.3.120.0090.00914.71
7.3.110.0030.01314.64
7.3.100.0030.00914.75
7.3.90.0060.00614.79
7.3.80.0080.00914.74
7.3.70.0050.00514.79
7.3.60.0070.00914.63
7.3.50.0020.01014.72
7.3.40.0050.01014.83
7.3.30.0090.00614.77
7.3.20.0000.01116.47
7.3.10.0050.00716.55
7.3.00.0110.00716.44
7.2.240.0000.01914.89
7.2.230.0060.00614.79
7.2.220.0090.00615.06
7.2.210.0040.01214.95
7.2.200.0110.00515.05
7.2.190.0020.01414.83
7.2.180.0100.00715.05
7.2.170.0050.01014.92
7.2.160.0110.00515.09
7.2.150.0090.00516.92
7.2.140.0050.00716.62
7.2.130.0030.01316.82
7.2.120.0050.01116.79
7.2.110.0060.00916.70
7.2.100.0000.01416.86
7.2.90.0080.01016.94
7.2.80.0050.00816.84
7.2.70.0060.00716.65
7.2.60.0070.00816.83
7.2.50.0030.01016.75
7.2.40.0060.00916.83
7.2.30.0090.00716.93
7.2.20.0030.01216.79
7.2.10.0040.01116.83
7.2.00.0040.01217.61
7.1.330.0060.01215.67
7.1.320.0070.00715.79
7.1.310.0030.00915.64
7.1.300.0050.00715.60
7.1.290.0080.00815.70
7.1.280.0000.01615.53
7.1.270.0060.00815.58
7.1.260.0100.00315.74
7.1.250.0100.00315.57
7.1.100.0000.00918.04
7.1.70.0030.00716.70
7.1.60.0070.01819.82
7.1.50.0140.01016.80
7.1.00.0030.07322.28
7.0.200.0080.00016.69
7.0.140.0000.07722.01
7.0.60.0270.08020.07
7.0.50.0030.08017.83
7.0.40.0170.07320.14
7.0.30.0130.09320.08
7.0.20.0170.06020.06
7.0.10.0230.04020.26
7.0.00.0070.05320.06
5.6.280.0000.07721.15
5.6.210.0030.08020.46
5.6.200.0130.07718.20
5.6.190.0100.08720.49
5.6.180.0270.05320.49
5.6.170.0370.07020.53
5.6.160.0070.05020.48
5.6.150.0000.04318.19
5.6.140.0070.04318.29
5.6.130.0030.04318.15
5.6.120.0070.08020.92
5.6.110.0100.08020.98
5.6.100.0000.04721.11
5.6.90.0130.07721.12
5.6.80.0100.04720.39
5.5.350.3830.04020.36
5.5.340.0100.04017.94
5.5.330.0170.07020.40
5.5.320.0070.08020.29
5.5.310.0230.07020.34
5.5.300.0100.07718.08
5.5.290.0100.06717.95
5.5.280.0130.07720.70
5.5.270.0130.06320.86
5.5.260.0100.08020.89
5.5.250.0070.08720.71
5.5.240.0270.07320.28
5.4.450.0630.06019.48
5.4.440.0830.05719.29
5.4.430.0770.05319.29
5.4.420.0830.05019.16
5.4.410.0770.04719.48
5.4.400.0800.05319.37
5.4.390.0100.05318.86
5.4.380.0270.05318.80
5.4.370.0170.04718.58
5.4.360.0170.03318.50
5.4.350.0070.03712.04
5.4.340.0090.04212.04
5.4.320.0060.03512.52
5.4.310.0060.04012.52
5.4.300.0080.03712.52
5.4.290.0070.03712.52
5.4.280.0100.03612.42
5.4.270.0060.04012.42
5.4.260.0030.05718.89
5.4.250.0130.05019.05
5.4.240.0130.05018.89
5.4.230.0100.05718.77
5.4.220.0100.05719.05
5.4.210.0070.05718.84
5.4.200.0130.06718.61
5.4.190.0170.07018.83
5.4.180.0170.06718.80
5.4.170.0070.05318.61
5.4.160.0170.06719.03
5.4.150.0200.04718.86
5.4.140.0100.05016.41
5.4.130.0030.05316.44
5.4.120.0100.04716.64
5.4.110.0070.05316.41
5.4.100.0030.05716.43
5.4.90.0170.04316.53
5.4.80.0100.05016.23
5.4.70.0100.06016.58
5.4.60.0070.05716.31
5.4.50.0070.06716.22
5.4.40.0070.05016.45
5.4.30.0170.04316.38
5.4.20.0100.04716.44
5.4.10.0030.07316.44
5.4.00.0100.04715.89
5.3.290.0040.04212.80
5.3.280.0130.05014.73
5.3.270.0170.06014.74
5.3.260.0070.05314.54
5.3.250.0130.07014.63
5.3.240.0000.06014.66
5.3.230.0200.04314.79
5.3.220.0070.05014.68
5.3.210.0070.05014.44
5.3.200.0100.05014.59
5.3.190.0130.06314.66
5.3.180.0100.04714.57
5.3.170.0070.05014.74
5.3.160.0070.06014.68
5.3.150.0030.05314.77
5.3.140.0100.07014.65
5.3.130.0030.05314.56
5.3.120.0070.05314.71
5.3.110.0100.05014.64
5.3.100.0070.05014.14
5.3.90.0070.05014.03
5.3.80.0030.06314.14
5.3.70.0070.06014.03
5.3.60.0030.07314.00
5.3.50.0100.05713.95
5.3.40.0130.06314.00
5.3.30.0130.05713.94
5.3.20.0100.04713.70
5.3.10.0070.04713.58
5.3.00.0100.06013.74
5.2.170.0030.04311.19
5.2.160.0070.04311.34
5.2.150.0170.04711.24
5.2.140.0030.05711.23
5.2.130.0030.04311.35
5.2.120.0000.06311.13
5.2.110.0000.04711.21
5.2.100.0170.03011.08
5.2.90.0000.04311.29
5.2.80.0000.04711.11
5.2.70.0070.04011.11
5.2.60.0030.04311.06
5.2.50.0130.03310.88
5.2.40.0070.04010.93
5.2.30.0030.04011.16
5.2.20.0000.04711.07
5.2.10.0030.05310.79
5.2.00.0030.04310.73
5.1.60.0070.04310.12
5.1.50.0100.0439.95
5.1.40.0100.0279.96
5.1.30.0070.04710.34
5.1.20.0130.03310.38
5.1.10.0070.03310.13
5.1.00.0070.05010.10
5.0.50.0070.0408.64
5.0.40.0000.0438.68
5.0.30.0000.0438.34
5.0.20.0100.0208.19
5.0.10.0030.0278.22
5.0.00.0000.0578.26
4.4.90.0030.0207.22
4.4.80.0030.0207.22
4.4.70.0030.0277.22
4.4.60.0030.0207.22
4.4.50.0070.0177.22
4.4.40.0000.0377.22
4.4.30.0070.0177.22
4.4.20.0070.0177.22
4.4.10.0070.0177.22
4.4.00.0030.0477.22
4.3.110.0000.0237.22
4.3.100.0030.0307.22
4.3.90.0000.0237.22
4.3.80.0070.0337.22
4.3.70.0000.0237.22
4.3.60.0030.0207.22
4.3.50.0030.0307.22
4.3.40.0070.0377.22
4.3.30.0000.0277.22
4.3.20.0000.0237.22
4.3.10.0030.0207.22
4.3.00.0100.0237.27

preferences:
38.68 ms | 400 KiB | 5 Q