3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getmsg($mbox,$mid) { global $charset,$htmlmsg,$plainmsg,$attachments; $htmlmsg = $plainmsg = $charset = ''; $attachments = array(); $h = imap_header($mbox,$mid); $s = imap_fetchstructure($mbox,$mid); if (!$s->parts) getpart($mbox,$mid,$s,0); else { foreach ($s->parts as $partno0=>$p) getpart($mbox,$mid,$p,$partno0+1); } echo $htmlmsg; } function getpart($mbox,$mid,$p,$partno) { global $htmlmsg,$plainmsg,$charset,$attachments; $data = ($partno)? imap_fetchbody($mbox,$mid,$partno): imap_body($mbox,$mid); if ($p->encoding==4) $data = quoted_printable_decode($data); elseif ($p->encoding==3) $data = base64_decode($data); $params = array(); if ($p->parameters) foreach ($p->parameters as $x) $params[strtolower($x->attribute)] = $x->value; if ($p->dparameters) foreach ($p->dparameters as $x) $params[strtolower($x->attribute)] = $x->value; if ($params['filename'] || $params['name']) { $filename = ($params['filename'])? $params['filename'] : $params['name']; $attachments[$filename] = $data; } if ($p->type==0 && $data) { if (strtolower($p->subtype)=='plain') $plainmsg.= trim($data) ."\n\n"; else $htmlmsg.= $data ."<br><br>"; $charset = $params['charset']; } elseif ($p->type==2 && $data) { $plainmsg.= $data."\n\n"; } if ($p->parts) { foreach ($p->parts as $partno0=>$p2) getpart($mbox,$mid,$p2,$partno.'.'.($partno0+1)); } }

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)
8.3.60.0070.00716.49
8.3.50.0140.00722.76
8.3.40.0110.00418.59
8.3.30.0100.00319.14
8.3.20.0000.00720.16
8.3.10.0050.00323.48
8.3.00.0080.00019.25
8.2.180.0080.00818.16
8.2.170.0120.00922.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.81
8.2.110.0090.00022.43
8.2.100.0060.00617.97
8.2.90.0070.00318.89
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0030.00617.68
8.2.50.0060.00318.07
8.2.40.0040.00418.03
8.2.30.0030.00517.96
8.2.20.0040.00417.49
8.2.10.0040.00418.06
8.2.00.0070.00017.61
8.1.280.0040.01425.92
8.1.270.0040.00423.72
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0000.01123.97
8.1.230.0070.00319.08
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00717.23
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0080.00018.71
8.1.160.0050.00221.85
8.1.150.0000.00718.82
8.1.140.0000.00717.43
8.1.130.0000.00717.93
8.1.120.0000.00817.45
8.1.110.0030.00517.27
8.1.100.0000.00717.41
8.1.90.0070.00017.31
8.1.80.0070.00017.29
8.1.70.0000.00717.25
8.1.60.0040.00417.45
8.1.50.0030.00617.54
8.1.40.0040.00417.39
8.1.30.0030.00517.58
8.1.20.0000.00817.58
8.1.10.0030.00517.48
8.1.00.0030.00517.39
8.0.300.0050.00218.77
8.0.290.0000.00716.75
8.0.280.0000.00818.25
8.0.270.0030.00317.11
8.0.260.0030.00317.19
8.0.250.0070.00016.88
8.0.240.0000.00716.93
8.0.230.0030.00316.86
8.0.220.0030.00316.74
8.0.210.0030.00316.74
8.0.200.0000.00616.81
8.0.190.0000.00916.78
8.0.180.0000.00816.75
8.0.170.0030.00616.87
8.0.160.0000.00716.80
8.0.150.0040.00416.74
8.0.140.0050.00216.78
8.0.130.0050.00013.20
8.0.120.0000.00816.70
8.0.110.0000.00816.77
8.0.100.0000.00716.88
8.0.90.0000.00716.62
8.0.80.0030.01216.86
8.0.70.0040.00416.68
8.0.60.0040.00416.69
8.0.50.0000.00716.88
8.0.30.0130.00617.02
8.0.20.0080.00917.40
8.0.10.0040.00417.05
8.0.00.0110.00716.69
7.4.330.0050.00015.00
7.4.320.0000.00716.58
7.4.300.0000.00816.49
7.4.290.0000.00716.46
7.4.280.0040.00416.44
7.4.270.0070.00016.45
7.4.260.0040.00416.56
7.4.250.0050.00316.50
7.4.240.0000.00716.45
7.4.230.0040.00416.32
7.4.220.0070.01016.52
7.4.210.0070.01316.47
7.4.200.0040.00416.32
7.4.160.0110.00716.21
7.4.150.0140.00617.40
7.4.140.0090.00817.86
7.4.130.0100.00716.48
7.4.120.0090.01016.33
7.4.110.0060.01216.35
7.4.100.0030.01316.21
7.4.90.0090.00916.52
7.4.80.0080.00819.39
7.4.70.0040.01316.36
7.4.60.0080.00816.29
7.4.50.0000.00516.43
7.4.40.0090.00916.55
7.4.30.0030.01216.55
7.4.00.0060.01014.95
7.3.330.0020.00213.23
7.3.320.0000.00613.17
7.3.310.0030.00316.25
7.3.300.0000.00716.16
7.3.290.0040.01116.27
7.3.280.0090.00616.24
7.3.270.0090.01317.40
7.3.260.0120.01316.50
7.3.250.0060.01016.48
7.3.240.0070.01016.46
7.3.230.0170.00016.46
7.3.210.0000.01716.50
7.3.200.0130.01319.39
7.3.190.0140.00416.37
7.3.180.0070.01016.23
7.3.170.0090.00616.38
7.3.160.0100.01016.54
7.3.120.0040.01414.67
7.3.110.0100.00714.78
7.3.100.0090.00914.75
7.3.90.0030.01214.40
7.3.80.0060.00614.44
7.3.70.0030.01314.75
7.3.60.0000.00814.80
7.3.50.0040.01114.72
7.3.40.0060.01014.84
7.3.30.0040.00814.84
7.3.20.0120.00616.53
7.3.10.0090.00616.46
7.3.00.0090.00616.48
7.2.330.0080.00916.64
7.2.320.0080.01116.61
7.2.310.0080.00816.54
7.2.300.0090.00616.43
7.2.290.0060.01216.36
7.2.250.0070.01015.12
7.2.240.0060.01315.10
7.2.230.0030.01014.70
7.2.220.0110.00414.84
7.2.210.0030.01214.96
7.2.200.0030.01414.76
7.2.190.0070.00714.92
7.2.180.0090.00914.89
7.2.170.0030.00615.02
7.1.330.0070.00715.46
7.1.320.0000.00915.76
7.1.310.0060.00315.55
7.1.300.0080.00015.40
7.1.290.0080.00415.49
7.1.280.0040.00815.55
7.1.270.0000.01115.48
7.1.260.0030.01015.61
7.1.100.0070.00717.86
7.1.70.0030.01016.77
7.1.60.0090.01519.40
7.1.50.0090.01216.79
7.1.00.0070.08722.31
7.0.200.0000.00716.59
7.0.140.0070.07022.04
7.0.60.0100.07719.96
7.0.50.0130.07318.01
7.0.40.0070.08320.10
7.0.30.0400.07320.16
7.0.20.0300.07020.10
7.0.10.0200.07720.09
7.0.00.0170.07020.12
5.6.280.0070.06721.12
5.6.210.0070.08320.54
5.6.200.0070.07018.25
5.6.190.0030.04720.33
5.6.180.4230.04020.66
5.6.170.0230.08020.48
5.6.160.0000.09320.39
5.6.150.0000.04318.18
5.6.140.0070.08018.18
5.6.130.0030.04318.16
5.6.120.0130.07721.04
5.6.110.0130.07721.03
5.6.100.0100.08020.91
5.6.90.0100.07721.00
5.6.80.0030.06320.43
5.5.350.0130.03720.39
5.5.340.0000.08717.96
5.5.330.0070.04320.40
5.5.320.0500.05720.25
5.5.310.0230.07020.23
5.5.300.0130.07317.95
5.5.290.0070.07318.09
5.5.280.0030.04320.89
5.5.270.0100.08020.88
5.5.260.0200.05320.70
5.5.250.0070.06720.61
5.5.240.0130.07720.21
5.4.450.0170.05019.28
5.4.440.0270.04719.30
5.4.430.0230.04319.48
5.4.420.0470.03719.54
5.4.410.0400.03319.36
5.4.400.0370.04019.07
5.4.390.0270.05019.16
5.4.380.0230.06018.49
5.4.370.0430.05718.45
5.4.360.0430.05318.75
5.4.350.0370.07718.53
5.4.340.0400.05718.59
5.4.320.0070.04612.52
5.4.310.0040.04612.52
5.4.300.0060.04112.53
5.4.290.0080.03612.52
5.4.280.0100.03612.42
5.4.270.0100.03912.42
5.4.260.0060.03812.42
5.4.250.0040.04212.42
5.4.240.0130.02812.42
5.4.230.0070.03812.41
5.4.220.0070.03812.41
5.4.210.0070.04412.41
5.4.200.0040.03912.41
5.4.190.0080.03312.40
5.4.180.0090.03512.41
5.4.170.0050.03712.41
5.4.160.0050.05012.41
5.4.150.0060.03712.41
5.4.140.0080.03612.09
5.4.130.0080.04712.08
5.4.120.0100.04612.03
5.4.110.0070.04612.03
5.4.100.0070.03412.04
5.4.90.0060.03812.03
5.4.80.0070.03812.03
5.4.70.0040.03812.03
5.4.60.0030.04312.03
5.4.50.0120.04112.03
5.4.40.0090.04512.02
5.4.30.0060.03712.02
5.4.20.0050.03612.01
5.4.10.0050.03512.02
5.4.00.0050.03611.50
5.3.290.0040.04012.80
5.3.280.0050.03912.71
5.3.270.0060.03912.73
5.3.260.0060.03812.72
5.3.250.0050.03912.72
5.3.240.0070.03712.72
5.3.230.0070.03712.71
5.3.220.0030.03912.68
5.3.210.0060.03812.68
5.3.200.0060.04412.68
5.3.190.0080.03612.68
5.3.180.0040.03812.68
5.3.170.0080.04612.66
5.3.160.0120.04512.68
5.3.150.0110.04812.68
5.3.140.0080.03412.66
5.3.130.0060.03912.66
5.3.120.0030.04112.66
5.3.110.0050.03912.66
5.3.100.0070.03512.14
5.3.90.0060.03512.13
5.3.80.0050.03712.11
5.3.70.0080.04812.11
5.3.60.0120.03212.11
5.3.50.0040.04112.05
5.3.40.0030.03912.05
5.3.30.0040.04312.01
5.3.20.0060.03511.79
5.3.10.0040.03611.76
5.3.00.0070.03811.74
5.2.170.0030.0339.25
5.2.160.0060.0299.25
5.2.150.0040.0319.25
5.2.140.0040.0339.25
5.2.130.0050.0309.20
5.2.120.0040.0319.20
5.2.110.0040.0309.21
5.2.100.0040.0309.20
5.2.90.0060.0359.20
5.2.80.0030.0339.20
5.2.70.0080.0269.20
5.2.60.0020.0339.16
5.2.50.0060.0299.13
5.2.40.0030.0309.11
5.2.30.0050.0309.07
5.2.20.0040.0309.06
5.2.10.0040.0318.97
5.2.00.0080.0278.83
5.1.60.0050.0248.11
5.1.50.0050.0248.11
5.1.40.0050.0248.10
5.1.30.0070.0238.45
5.1.20.0040.0278.46
5.1.10.0020.0288.20
5.1.00.0050.0248.19
5.0.50.0020.0216.68
5.0.40.0030.0206.54
5.0.30.0040.0346.35
5.0.20.0070.0186.32
5.0.10.0040.0196.30
5.0.00.0030.0316.29
4.4.90.0020.0164.78
4.4.80.0030.0154.75
4.4.70.0020.0164.76
4.4.60.0030.0154.76
4.4.50.0020.0164.77
4.4.40.0050.0344.71
4.4.30.0020.0184.76
4.4.20.0040.0164.85
4.4.10.0030.0164.85
4.4.00.0030.0324.76
4.3.110.0030.0224.67
4.3.100.0040.0174.66
4.3.90.0050.0164.63
4.3.80.0070.0314.58
4.3.70.0050.0214.63
4.3.60.0040.0164.63
4.3.50.0050.0184.63
4.3.40.0050.0314.54
4.3.30.0030.0223.34
4.3.20.0030.0173.32
4.3.10.0020.0203.28
4.3.00.0070.01315.64

preferences:
63.21 ms | 401 KiB | 5 Q