3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset ($_POST["send"])) { $upload_name=$_FILES["upload"]["name"]; $upload_type=$_FILES["upload"]["type"]; $upload_size=$_FILES["upload"]["size"]; $upload_temp=$_FILES["upload"]["tmp_name"]; $message=$_POST["msg"]; $subject = $_POST["subject"]; $to=$_POST["to"]; $from=$_POST["from"]; if($message==""||$subject==""||$to==""||$from=="") { echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#F3363F; font-weight:bold">Please fill all fields</font>'; } else { $fp = fopen($upload_temp, "rb"); $file = fread($fp, $upload_size); $file = chunk_split(base64_encode($file)); $num = md5(time()); //Normal headers $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/mixed; "; $headers .= "boundary=".$num."\r\n"; $headers .= "--$num\r\n"; $headers ="Return-Path: <".clean_msg($from).">\n"; $headers .="From: ".clean_msg($from)." <".clean_msg($youremail).">\n"; $headers .="X-Mailer: PHP/".phpversion()."\n"; $headers .="X-Sender: ".$_SERVER['REMOTE_ADDR']."\n"; // This two steps to help avoid spam $headers .= "Message-ID: <".gettimeofday()." TheSystem@".$_SERVER['SERVER_NAME'].">\r\n"; $headers .= "X-Mailer: PHP v".phpversion()."\r\n"; // With message $headers .= "Content-Type: text/html; charset=iso-8859-1\r\n"; $headers .= "Content-Transfer-Encoding: 8bit\r\n"; $headers .= "".$message."\n"; $headers .= "--".$num."\n"; // Attachment headers $headers .= "Content-Type:".$upload_type." "; $headers .= "name=\"".$upload_name."\"r\n"; $headers .= "Content-Transfer-Encoding: base64\r\n"; $headers .= "Content-Disposition: attachment; "; $headers .= "filename=\"".$upload_name."\"\r\n\n"; $headers .= "".$file."\r\n"; $headers .= "--".$num."--"; // SEND MAIL @mail($to, $subject, $message, $headers); fclose($fp); echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#333333; font-weight:bold">Mail sent please check inbox and spam both <br /></font>'; } } ?> <form id="attach" name="attach" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" enctype="multipart/form-data"> <table> <tr> <td>From</td><td>:</td><td><input type="text" name="from" id="from"></td> </tr> <tr> <td>To</td><td>:</td><td><input type="text" name="to" id="to"></td> </tr> <tr> <td>Subject</td><td>:</td><td><input type="text" name="subject" id="subject"></td> </tr> <tr> <td>Message</td><td>:</td><td><input type="text" name="msg" id="msg"></td> </tr> <tr> <td>Attachment<span class="imp">*</span></td><td>:</td><td><input type="file" name="upload" id="upload"></td> </tr> <tr> <td></td><td></td><td><input type="submit" value="Submit" id="send" name="send"></td> </tr> </table> </form>

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.4.00.0070.00915.02
7.3.120.0070.00714.67
7.3.110.0030.00814.95
7.3.100.0100.00414.55
7.3.90.0090.00414.87
7.3.80.0060.00914.89
7.3.70.0080.00614.64
7.3.60.0030.01014.57
7.3.50.0000.01414.80
7.3.40.0030.01014.80
7.3.30.0110.00314.89
7.3.20.0090.00816.61
7.3.10.0090.00616.71
7.3.00.0030.01016.63
7.2.250.0060.00614.88
7.2.240.0110.00815.06
7.2.230.0050.00915.01
7.2.220.0050.00914.75
7.2.210.0060.00815.14
7.2.200.0030.01115.12
7.2.190.0060.01014.88
7.2.180.0080.00814.79
7.2.170.0040.01015.01
7.2.00.0080.00419.31
7.1.330.0050.00915.68
7.1.320.0060.00715.57
7.1.310.0050.01115.74
7.1.300.0110.00515.57
7.1.290.0050.00915.56
7.1.280.0040.00715.73
7.1.270.0070.00615.68
7.1.260.0020.01515.66
7.1.100.0060.00618.25
7.1.70.0000.01116.64
7.1.60.0070.01819.82
7.1.50.0070.01716.86
7.1.00.0030.07022.37
7.0.200.0040.00816.77
7.0.140.0030.07322.08
7.0.80.0500.05319.94
7.0.70.0500.04020.01
7.0.60.0470.08019.84
7.0.50.0570.08020.34
7.0.40.0100.08019.95
7.0.30.0030.08320.09
7.0.20.0100.04020.09
7.0.10.0100.07720.02
7.0.00.0070.08320.09
5.6.280.0030.07021.06
5.6.230.0070.06320.77
5.6.220.0100.03720.66
5.6.210.0030.04320.57
5.6.200.0100.08321.03
5.6.190.0170.08021.09
5.6.180.0070.05021.13
5.6.170.0070.07721.05
5.6.160.0130.06720.98
5.6.150.0070.08721.04
5.6.140.0130.07321.04
5.6.130.0030.05321.05
5.6.120.0070.06721.02
5.6.110.0100.04021.09
5.6.100.0000.04721.11
5.6.90.0100.06721.02
5.6.80.0130.07320.44
5.6.70.0030.07720.44
5.6.60.0030.05320.55
5.6.50.0130.08020.51
5.6.40.0070.06320.39
5.6.30.0130.05720.47
5.6.20.0030.08020.39
5.6.10.0170.07020.46
5.6.00.0030.05720.40
5.5.370.0030.08020.47
5.5.360.0030.08720.43
5.5.350.0070.08320.35
5.5.340.0070.07720.84
5.5.330.0100.08320.95
5.5.320.0070.07320.91
5.5.310.0070.04720.93
5.5.300.0170.07020.93
5.5.290.0070.09020.88
5.5.280.0000.05720.89
5.5.270.0070.04720.91
5.5.260.0070.04320.90
5.5.250.0170.05020.66
5.5.240.0070.04020.23
5.5.230.0070.05320.23
5.5.220.0070.08020.31
5.5.210.0000.08720.29
5.5.200.0070.06720.26
5.5.190.0030.07720.01
5.5.180.0000.04720.23
5.5.160.0100.05320.16
5.5.150.0030.04320.24
5.5.140.0070.03720.26
5.5.130.0100.04320.14
5.5.120.0130.07320.25
5.5.110.0130.06320.29
5.5.100.0000.05020.14
5.5.90.0030.08320.10
5.5.80.0030.08020.09
5.5.70.0070.05020.02
5.5.60.0030.05020.18
5.5.50.0130.03020.07
5.5.40.0030.04020.11
5.5.30.0070.03720.01
5.5.20.0070.03720.06
5.5.10.0100.04720.07
5.5.00.0000.04320.09
5.4.450.0130.07719.34
5.4.440.0130.07019.54
5.4.430.0000.05319.36
5.4.420.0000.06719.42
5.4.410.0170.04319.01
5.4.400.0000.04719.06
5.4.390.0000.05019.22
5.4.380.0030.08018.95
5.4.370.0100.05019.16
5.4.360.0070.05718.89
5.4.350.0030.06319.12
5.4.340.0030.04318.94
5.4.320.0030.06718.98
5.4.310.0070.04719.02
5.4.300.0000.08319.14
5.4.290.0070.06319.02
5.4.280.0130.07018.89
5.4.270.0100.07018.96
5.4.260.0070.04719.11
5.4.250.0130.07019.05
5.4.240.0230.03719.09
5.4.230.0200.03018.97
5.4.220.0030.05318.89
5.4.210.0070.03719.04
5.4.200.0070.04019.02
5.4.190.0030.03718.96
5.4.180.0070.03319.13
5.4.170.0000.05318.96
5.4.160.0130.02719.09
5.4.150.0000.04319.04
5.4.140.0000.04316.35
5.4.130.0000.04016.38
5.4.120.0000.03716.12
5.4.110.0070.04016.43
5.4.100.0030.03316.32
5.4.90.0070.03016.33
5.4.80.0030.03316.25
5.4.70.0030.05716.39
5.4.60.0100.02716.24
5.4.50.0070.06316.29
5.4.40.0070.04716.33
5.4.30.0000.04016.20
5.4.20.0000.05716.30
5.4.10.0000.04316.46
5.4.00.0130.05715.73
5.3.290.0030.07314.52
5.3.280.0030.04014.45
5.3.270.0030.03714.56
5.3.260.0100.02714.46
5.3.250.0030.06314.62
5.3.240.0030.03714.60
5.3.230.0030.03714.48
5.3.220.0000.04314.41
5.3.210.0000.03714.55
5.3.200.0100.02714.57
5.3.190.0000.04014.54
5.3.180.0100.03014.54
5.3.170.0100.03014.57
5.3.160.0030.03714.57
5.3.150.0100.04314.45
5.3.140.0070.03314.52
5.3.130.0030.04014.43
5.3.120.0030.04014.43
5.3.110.0030.03314.56
5.3.100.0030.05014.05
5.3.90.0000.03314.03
5.3.80.0030.05713.98
5.3.70.0000.04014.02
5.3.60.0030.03713.77
5.3.50.0000.04013.92
5.3.40.0030.03713.90
5.3.30.0070.03313.88
5.3.20.0030.05713.57
5.3.10.0070.02713.53
5.3.00.0000.03713.64
5.2.170.0000.03711.13
5.2.160.0000.02711.16
5.2.150.0000.03011.23
5.2.140.0000.03011.13
5.2.130.0000.03311.11
5.2.120.0000.03010.93
5.2.110.0000.03011.19
5.2.100.0030.02710.97
5.2.90.0000.03011.11
5.2.80.0030.03311.16
5.2.70.0030.03011.16
5.2.60.0000.03311.02
5.2.50.0030.02311.09
5.2.40.0030.05011.04
5.2.30.0000.04010.81
5.2.20.0000.03311.05
5.2.10.0030.02310.83
5.2.00.0000.03310.79
5.1.60.0000.03010.11
5.1.50.0000.04310.03
5.1.40.0100.0139.88
5.1.30.0070.02310.38
5.1.20.0070.02710.43
5.1.10.0000.0279.97
5.1.00.0000.02710.14
5.0.50.0000.0478.58
5.0.40.0030.0438.42
5.0.30.0100.0608.25
5.0.20.0000.0308.23
5.0.10.0030.0308.23
5.0.00.0000.0408.05
4.4.90.0000.0177.71
4.4.80.0030.0137.71
4.4.70.0030.0107.71
4.4.60.0000.0177.71
4.4.50.0000.0177.71
4.4.40.0000.0337.71
4.4.30.0000.0177.71
4.4.20.0000.0177.71
4.4.10.0000.0337.71
4.4.00.0070.0537.71
4.3.110.0030.0337.71
4.3.100.0070.0307.71
4.3.90.0000.0437.71
4.3.80.0070.0207.71
4.3.70.0030.0277.71
4.3.60.0030.0307.71
4.3.50.0030.0237.71
4.3.40.0070.0477.71
4.3.30.0030.0377.71
4.3.20.0000.0277.71
4.3.10.0000.0377.71
4.3.00.0000.0307.71

preferences:
39.19 ms | 401 KiB | 5 Q