3v4l.org

run code in 300+ PHP versions simultaneously
<?php //define the receiver of the email $to = 'bibui@mines.edu'; //define the subject of the email $subject = 'Test HTML email'; //create a boundary string. It must be unique //so we use the MD5 algorithm to generate a random hash $random_hash = md5(date('r', time())); //define the headers we want passed. Note that they are separated with \r\n $headers = "From: aab@gmail.com\r\nReply-To: aab@gmail.com"; //add boundary string and mime type specification $headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; //define the body of the message. ob_start(); //Turn on output buffering ?> --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello World!!! This is simple text email message. --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <h2>Hello World!</h2> <p>This is something with <b>HTML</b> formatting.</p> --PHP-alt-<?php echo $random_hash; ?>-- <? //copy current buffer contents into $message variable and delete current output buffer $message = ob_get_clean(); //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" echo $mail_sent ? "Mail sent" : "Mail failed"; ?>

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.0170.00014.84
7.3.110.0100.01015.13
7.3.100.0040.01214.79
7.3.90.0030.01315.06
7.3.80.0090.00614.94
7.3.70.0120.00314.71
7.3.60.0100.00314.95
7.3.50.0040.01215.14
7.3.40.0050.00515.02
7.3.30.0070.01015.23
7.3.20.0040.01216.78
7.3.10.0090.00016.63
7.3.00.0030.00616.86
7.2.240.0100.01015.51
7.2.230.0040.01415.16
7.2.220.0060.00614.96
7.2.210.0060.00915.16
7.2.200.0070.00715.35
7.2.190.0120.00614.97
7.2.180.0070.01015.29
7.2.170.0000.00915.22
7.2.160.0060.00814.97
7.2.150.0070.00317.09
7.2.140.0060.00616.97
7.2.130.0080.00816.96
7.2.120.0060.01017.11
7.2.110.0090.00617.04
7.2.100.0000.01617.00
7.2.90.0090.00617.22
7.2.80.0000.01417.11
7.2.70.0080.00316.84
7.2.60.0050.00817.15
7.2.50.0060.00616.77
7.2.40.0040.01416.80
7.2.30.0060.01017.06
7.2.20.0030.00617.19
7.2.10.0040.00416.98
7.2.00.0040.01218.34
7.1.330.0060.00915.82
7.1.320.0050.00915.92
7.1.310.0070.00716.04
7.1.300.0030.01015.60
7.1.290.0030.00715.71
7.1.280.0050.01315.85
7.1.270.0120.00315.59
7.1.260.0000.01115.91
7.1.250.0000.01215.98
7.1.200.0030.00615.94
7.1.100.0050.00518.23
7.1.70.0000.00817.14
7.1.60.0040.00719.22
7.1.50.0060.01617.13
7.1.00.0070.07322.36
7.0.200.0060.00616.91
7.0.140.0030.06722.00
7.0.90.0070.08319.87
7.0.80.0070.08019.88
7.0.70.0070.08019.96
7.0.60.0070.05319.97
7.0.50.0070.04320.40
7.0.40.0070.05019.96
7.0.30.0130.05320.07
7.0.20.0030.04320.10
7.0.10.0100.03020.14
7.0.00.0030.04020.09
5.6.280.0070.07021.11
5.6.240.0070.07320.66
5.6.230.0100.08020.67
5.6.220.0100.04020.67
5.6.210.0030.06020.45
5.6.200.0170.07320.96
5.6.190.0070.05321.04
5.6.180.0070.04720.96
5.6.170.0000.04721.04
5.6.160.0030.04721.11
5.6.150.0100.07021.04
5.6.140.0070.03721.11
5.6.130.0130.03021.04
5.6.120.0070.04020.91
5.6.110.0030.04021.06
5.6.100.0030.04320.94
5.6.90.0030.07020.99
5.6.80.0030.04020.34
5.6.70.0030.05020.33
5.6.60.0030.04020.40
5.6.50.0030.04020.48
5.6.40.0030.04020.30
5.6.30.0030.03320.52
5.6.20.0030.03720.43
5.6.10.0070.03020.43
5.6.00.0000.04720.27
5.5.380.0030.03720.44
5.5.370.0000.09020.39
5.5.360.0030.05320.35
5.5.350.0030.04720.45
5.5.340.0100.04320.86
5.5.330.0130.03720.87
5.5.320.0070.03720.89
5.5.310.0000.04320.90
5.5.300.0070.04020.93
5.5.290.0070.04720.89
5.5.280.0030.04720.86
5.5.270.0000.04720.86
5.5.260.0030.04020.90
5.5.250.0030.03320.60
5.5.240.0000.04020.17
5.5.230.0030.04020.24
5.5.220.0070.03320.26
5.5.210.0070.03720.29
5.5.200.0100.02720.23
5.5.190.0100.05020.21
5.5.180.0030.04320.11
5.5.160.0030.03720.08
5.5.150.0070.03720.14
5.5.140.0030.04020.21
5.5.130.0100.03020.08
5.5.120.0030.04320.22
5.5.110.0070.03020.12
5.5.100.0030.04020.07
5.5.90.0000.04020.11
5.5.80.0000.03720.16
5.5.70.0000.04320.03
5.5.60.0100.06319.96
5.5.50.0100.07320.15
5.5.40.0070.08020.15
5.5.30.0130.06719.93
5.5.20.0070.07320.05
5.5.10.0100.07320.03
5.5.00.0030.05320.06
5.4.450.0030.04719.47
5.4.440.0030.04019.41
5.4.430.0030.03319.43
5.4.420.0000.03719.42
5.4.410.0070.03719.34
5.4.400.0100.04319.10
5.4.390.0030.04019.07
5.4.380.0030.03719.03
5.4.370.0000.04018.96
5.4.360.0030.03719.10
5.4.350.0070.03318.98
5.4.340.0000.04019.14
5.4.320.0100.03019.09
5.4.310.0030.03718.90
5.4.300.0030.05719.22
5.4.290.0000.04319.10
5.4.280.0000.05019.12
5.4.270.0000.04019.09
5.4.260.0000.04719.04
5.4.250.0000.05318.89
5.4.240.0000.04019.09
5.4.230.0000.05318.96
5.4.220.0170.05719.07
5.4.210.0070.07319.04
5.4.200.0100.07319.14
5.4.190.0100.07318.82
5.4.180.0030.07019.13
5.4.170.0070.07318.89
5.4.160.0130.05019.21
5.4.150.0130.06719.07
5.4.140.0070.05316.38
5.4.130.0000.08016.42
5.4.120.0130.05716.40
5.4.110.0000.04316.26
5.4.100.0070.07316.34
5.4.90.0000.04716.38
5.4.80.0000.07316.34
5.4.70.0000.04316.43
5.4.60.0030.07316.39
5.4.50.0070.07316.32
5.4.40.0030.07316.40
5.4.30.0030.08016.40
5.4.20.0030.06316.30
5.4.10.0030.07316.39
5.4.00.0030.06715.80
5.3.290.0000.03714.52
5.3.280.0000.04714.51
5.3.270.0030.07014.54
5.3.260.0100.07714.43
5.3.250.0070.07314.47
5.3.240.0130.06714.47
5.3.230.0100.07014.42
5.3.220.0130.07314.53
5.3.210.0070.07714.56
5.3.200.0000.04714.48
5.3.190.0100.07014.43
5.3.180.0070.07314.42
5.3.170.0070.06314.43
5.3.160.0100.04014.50
5.3.150.0200.06714.51
5.3.140.0070.07714.47
5.3.130.0130.07014.50
5.3.120.0070.04014.51
5.3.110.0170.06314.43
5.3.100.0000.08314.02
5.3.90.0070.07313.88
5.3.80.0070.07314.00
5.3.70.0070.05313.88
5.3.60.0030.04013.98
5.3.50.0030.07713.80
5.3.40.0030.07313.91
5.3.30.0300.03013.91
5.3.20.0030.07713.70
5.3.10.0100.06713.52
5.3.00.0070.04013.49
5.2.170.0070.06711.01
5.2.160.0070.06010.94
5.2.150.0070.06011.16
5.2.140.0000.07010.93
5.2.130.0000.03311.10
5.2.120.0070.06011.10
5.2.110.0070.05711.15
5.2.100.0030.04310.95
5.2.90.0030.06710.94
5.2.80.0130.05311.02
5.2.70.0000.06711.04
5.2.60.0070.06010.90
5.2.50.0030.05711.02
5.2.40.0100.05310.98
5.2.30.0030.06710.92
5.2.20.0000.06310.89
5.2.10.0070.04710.72
5.2.00.0030.05310.64
5.1.60.0030.02710.47
5.1.50.0030.04710.47
5.1.40.0030.05310.47
5.1.30.0070.02710.47
5.1.20.0000.06010.47
5.1.10.0000.03310.47
5.1.00.0000.02710.47
5.0.50.0000.02310.47
5.0.40.0000.02710.47
5.0.30.0000.04010.47
5.0.20.0030.04010.47
5.0.10.0030.04010.47
5.0.00.0000.06310.47
4.4.90.0000.03710.47
4.4.80.0030.03710.47
4.4.70.0070.03710.47
4.4.60.0070.03010.47
4.4.50.0000.02310.47
4.4.40.0000.03710.47
4.4.30.0000.03310.47
4.4.20.0000.03710.47
4.4.10.0000.02310.47
4.4.00.0070.04710.47
4.3.110.0070.02010.47
4.3.100.0000.03710.47
4.3.90.0100.03010.47
4.3.80.0000.05310.47
4.3.70.0070.03010.47
4.3.60.0030.03310.47
4.3.50.0000.04010.47
4.3.40.0070.04710.47
4.3.30.0000.02010.47
4.3.20.0030.01310.47
4.3.10.0070.03310.47
4.3.00.0000.03010.47

preferences:
43.98 ms | 401 KiB | 5 Q