3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = "λ"; $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->encoding = "UTF-8"; $dom->strictErrorChecking = false; $dom->substituteEntities = false; $dom->formatOutput = false; mb_detect_order("ASCII,UTF-8,ISO-8859-1,windows-1252,iso-8859-15"); function loadNprepare($content,$encod='') { if (!empty($content)) { if (empty($encod)) $encod = mb_detect_encoding($content); $headpos = mb_strpos($content,'<head>'); if (FALSE=== $headpos) $headpos= mb_strpos($content,'<HEAD>'); if (FALSE!== $headpos) { $headpos+=6; $content = mb_substr($content,0,$headpos) . '<meta http-equiv="Content-Type" content="text/html; charset='.$encod.'">' .mb_substr($content,$headpos); } $content=mb_convert_encoding($content, 'HTML-ENTITIES', $encod); } return $content; } // Little hack to force UTF-8 // if (strpos($content, '<?xml encoding') === false) { // $hack = strpos($content, '<body') === false ? '<?xml encoding="UTF-8"><meta http-equiv="content-type" content="text/html; charset=UTF-8"><body>' : '<?xml encoding="UTF-8">'; // $loaded = $dom->loadHTML($hack . $content); // } else { // $loaded = $dom->loadHTML($content); // } $dom->loadHTML(loadNprepare($content)); foreach ($dom->childNodes as $item) { if ($item->nodeType === XML_PI_NODE) { $dom->removeChild($item); // remove encoding hack break; } } // Remove added body & doctype $exportedContent = preg_replace(array( "/^\<\!DOCTYPE.*?<html><body>/si", "!</body></html>$!si"), "", $dom->saveHTML()); var_dump(trim($exportedContent)); // Should return string(8) "&lambda;"

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.40.0150.00019.28
8.3.30.0070.00719.40
8.3.20.0040.00420.43
8.3.10.0080.00023.73
8.3.00.0090.00019.76
8.2.170.0120.00622.96
8.2.160.0120.00920.77
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0090.00022.94
8.2.110.0030.00622.43
8.2.100.0000.01318.41
8.2.90.0040.00419.75
8.2.80.0030.00518.38
8.2.70.0060.00318.25
8.2.60.0060.00318.18
8.2.50.0030.00518.38
8.2.40.0040.00420.26
8.2.30.0080.00018.51
8.2.20.0040.00418.22
8.2.10.0030.00518.64
8.2.00.0090.00018.36
8.1.270.0060.00324.26
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00324.28
8.1.230.0100.00319.44
8.1.220.0060.00317.93
8.1.210.0060.00318.77
8.1.200.0090.00017.97
8.1.190.0070.00417.85
8.1.180.0000.00819.89
8.1.170.0040.00419.18
8.1.160.0000.00722.59
8.1.150.0020.00519.14
8.1.140.0000.00817.98
8.1.130.0050.00318.27
8.1.120.0080.00018.02
8.1.110.0040.00418.02
8.1.100.0070.00217.99
8.1.90.0000.00817.93
8.1.80.0000.00718.02
8.1.70.0070.00017.93
8.1.60.0030.00618.10
8.1.50.0050.00318.10
8.1.40.0000.00718.05
8.1.30.0040.00418.19
8.1.20.0000.00818.24
8.1.10.0030.00618.04
8.1.00.0070.00018.16
8.0.300.0000.00718.77
8.0.290.0000.00717.55
8.0.280.0000.00818.66
8.0.270.0040.00417.51
8.0.260.0070.00017.76
8.0.250.0000.00817.38
8.0.240.0000.00817.41
8.0.230.0030.00317.48
8.0.220.0030.00317.33
8.0.210.0070.00017.41
8.0.200.0000.00717.46
8.0.190.0030.00617.39
8.0.180.0000.00717.44
8.0.170.0040.00417.39
8.0.160.0050.00317.38
8.0.150.0000.00717.27
8.0.140.0000.00917.33
8.0.130.0000.00613.85
8.0.120.0000.00817.36
8.0.110.0000.00717.33
8.0.100.0030.00617.24
8.0.90.0050.00317.19
8.0.80.0060.01517.53
8.0.70.0030.00617.39
8.0.60.0070.00017.40
8.0.50.0000.00717.47
8.0.30.0090.01317.64
8.0.20.0120.01117.53
8.0.10.0040.00417.49
8.0.00.0040.01617.06
7.4.330.0030.00315.00
7.4.320.0040.00417.24
7.4.300.0060.00017.14
7.4.290.0030.00317.13
7.4.280.0000.00717.23
7.4.270.0040.00417.03
7.4.260.0030.00317.10
7.4.250.0030.00617.21
7.4.240.0010.00617.12
7.4.230.0000.00716.82
7.4.220.0130.00617.23
7.4.210.0090.00617.13
7.4.200.0080.00017.00
7.4.190.0000.00716.90
7.4.160.0050.01116.91
7.4.150.0070.01117.40
7.4.140.0090.00917.86
7.4.130.0100.00716.88
7.4.120.0080.00917.17
7.4.110.0090.00917.00
7.4.100.0060.01217.01
7.4.90.0130.00716.97
7.4.80.0090.01319.39
7.4.70.0070.01516.80
7.4.60.0070.01016.80
7.4.50.0060.00316.97
7.4.40.0030.01416.75
7.4.30.0030.01317.14
7.4.00.0070.01015.60
7.3.330.0030.00313.65
7.3.320.0000.00513.63
7.3.310.0000.00716.87
7.3.300.0000.00716.63
7.3.290.0060.00916.68
7.3.280.0070.01316.80
7.3.270.0140.00417.40
7.3.260.0070.01117.17
7.3.250.0100.01016.83
7.3.240.0130.00317.18
7.3.230.0000.01717.06
7.3.210.0110.00716.93
7.3.200.0170.00319.39
7.3.190.0060.01516.91
7.3.180.0160.00416.82
7.3.170.0100.00617.18
7.3.160.0170.00317.17
7.3.120.0070.01015.17
7.2.330.0100.01317.44
7.2.320.0040.01617.20
7.2.310.0070.01417.21
7.2.300.0030.02017.36
7.2.290.0100.01317.27
7.2.60.0070.00717.24
7.2.00.0030.00919.82
7.1.200.0060.00615.93
7.1.100.0070.00318.50
7.1.70.0000.00717.49
7.1.60.0070.01819.46
7.1.50.0130.01317.31
7.1.00.0000.08022.45
7.0.200.0060.00317.26
7.0.140.0030.07322.03
7.0.100.0100.08020.00
7.0.90.0030.06720.13
7.0.80.0100.08019.93
7.0.70.0070.08320.04
7.0.60.0100.08020.13
7.0.50.0130.07720.43
7.0.40.0030.08020.14
7.0.30.0030.09020.19
7.0.20.0100.07720.16
7.0.10.0000.05020.19
7.0.00.0070.07020.21
5.6.280.0000.07721.00
5.6.250.0130.07020.64
5.6.240.0030.08320.62
5.6.230.0030.07720.72
5.6.220.0130.07320.64
5.6.210.0070.07320.45
5.6.200.0070.08721.23
5.6.190.0130.07321.09
5.6.180.0100.04721.14
5.6.170.0070.08721.00
5.6.160.0130.07321.06
5.6.150.0130.08721.23
5.6.140.0070.05721.01
5.6.130.0030.08721.08
5.6.120.0030.08321.13
5.6.110.0130.04720.99
5.6.100.0130.07321.00
5.6.90.0130.04321.07
5.6.80.0100.08020.58
5.6.70.0070.08020.58
5.6.60.0070.08020.45
5.6.50.0130.07720.55
5.6.40.0130.07320.55
5.6.30.0130.05020.38
5.6.20.0070.08020.43
5.6.10.0030.07720.43
5.6.00.0070.07320.57
5.5.380.0070.07320.36
5.5.370.0170.07020.45
5.5.360.0100.07720.39
5.5.350.0100.07320.45
5.5.340.0200.06720.82
5.5.330.0130.07320.77
5.5.320.0130.06720.94
5.5.310.0130.07320.91
5.5.300.0030.08720.92
5.5.290.0130.08020.86
5.5.280.0070.08321.00
5.5.270.0100.08320.98
5.5.260.0100.07720.78
5.5.250.0170.07320.73
5.5.240.0170.07320.34
5.5.230.0070.08320.29
5.5.220.0070.05720.07
5.5.210.0070.07720.33
5.5.200.0070.04720.34
5.5.190.0100.08020.24
5.5.180.0030.05020.14
5.5.160.0200.06320.21
5.5.150.0100.06020.02
5.5.140.0100.07720.29
5.5.130.0000.07720.27
5.5.120.0100.05020.19
5.5.110.0030.08720.33
5.5.100.0130.06020.24
5.5.90.0130.07720.15
5.5.80.0030.07720.16
5.5.70.0100.07720.21
5.5.60.0030.08320.10
5.5.50.0330.03020.18
5.5.40.0130.07020.20
5.5.30.0070.08020.11
5.5.20.0100.07720.11
5.5.10.0170.06320.02
5.5.00.0070.07720.19
5.4.450.0100.06319.45
5.4.440.0200.07719.53
5.4.430.0070.07719.46
5.4.420.0170.07319.52
5.4.410.0070.07719.45
5.4.400.0070.07719.26
5.4.390.0130.07319.02
5.4.380.0070.05318.94
5.4.370.0100.04019.25
5.4.360.0170.07718.93
5.4.350.0100.07019.27
5.4.340.0000.08319.20
5.4.320.0070.07319.17
5.4.310.0070.07719.03
5.4.300.0070.07719.11
5.4.290.0130.06719.17
5.4.280.0070.07719.16
5.4.270.0200.06719.11
5.4.260.0100.07019.26
5.4.250.0000.06318.96
5.4.240.0100.07319.11
5.4.230.0030.08019.00
5.4.220.0130.07719.02
5.4.210.0030.07718.92
5.4.200.0100.07018.96
5.4.190.0100.07019.16
5.4.180.0100.07719.15
5.4.170.0030.07319.20
5.4.160.0030.07018.90
5.4.150.0100.07319.10
5.4.140.0070.04716.55
5.4.130.0000.04016.57
5.4.120.0070.05316.54
5.4.110.0100.06316.48
5.4.100.0130.06016.67
5.4.90.0200.05716.46
5.4.80.0130.06716.38
5.4.70.0000.07316.59
5.4.60.0070.07016.53
5.4.50.0130.04716.45
5.4.40.0070.07016.54
5.4.30.0070.07016.46
5.4.20.0030.04716.61
5.4.10.0100.06016.43
5.4.00.0200.06016.07
5.3.290.0200.07014.80
5.3.280.0070.08014.70
5.3.270.0070.04714.62
5.3.260.0130.06714.85
5.3.250.0130.07014.75
5.3.240.0030.04014.82
5.3.230.0070.04014.61
5.3.220.0100.07014.64
5.3.210.0070.07314.71
5.3.200.0070.04714.64
5.3.190.0170.05714.59
5.3.180.0030.04314.74
5.3.170.0070.05014.73
5.3.160.0130.07014.63
5.3.150.0130.07314.67
5.3.140.0100.07714.57
5.3.130.0070.07014.69
5.3.120.0200.06014.79
5.3.110.0070.07714.68
5.3.100.0030.07314.18
5.3.90.0170.06014.15
5.3.80.0000.05314.01
5.3.70.0070.07714.02
5.3.60.0130.07014.25
5.3.50.0130.07014.01
5.3.40.0030.07314.12
5.3.30.0030.07014.08
5.3.20.0100.07013.86
5.3.10.0100.07313.72
5.3.00.0030.07013.79
5.2.170.0030.04311.44
5.2.160.0070.06311.44
5.2.150.0030.06011.44
5.2.140.0000.04011.44
5.2.130.0100.05711.44
5.2.120.0030.06711.44
5.2.110.0100.06311.44
5.2.100.0070.06011.44
5.2.90.0100.05311.44
5.2.80.0100.05711.44
5.2.70.0030.04711.44
5.2.60.0070.06011.44
5.2.50.0070.06011.44
5.2.40.0070.06311.44
5.2.30.0030.06011.44
5.2.20.0070.03711.44
5.2.10.0070.03011.44
5.2.00.0070.06011.44
5.1.60.0030.05011.44
5.1.50.0070.05311.44
5.1.40.0030.05011.44
5.1.30.0100.04711.44
5.1.20.0100.05311.44
5.1.10.0000.04311.44
5.1.00.0030.05711.44
5.0.50.0070.04011.44
5.0.40.0030.04711.44
5.0.30.0070.05311.44
5.0.20.0000.04711.44
5.0.10.0070.03711.44
5.0.00.0000.06311.44
4.4.90.0070.03311.44
4.4.80.0030.03311.44
4.4.70.0070.03311.44
4.4.60.0100.02711.44
4.4.50.0000.02311.44
4.4.40.0070.05311.44
4.4.30.0100.02711.44
4.4.20.0000.04011.44
4.4.10.0030.02311.44
4.4.00.0030.05311.44
4.3.110.0000.03711.44
4.3.100.0070.02711.44
4.3.90.0000.03311.44
4.3.80.0030.04311.44
4.3.70.0000.03311.44
4.3.60.0000.03311.44
4.3.50.0100.02711.44
4.3.40.0130.04311.44
4.3.30.0000.03711.44
4.3.20.0030.03311.44
4.3.10.0000.03711.44
4.3.00.0000.03711.44

preferences:
39.85 ms | 400 KiB | 5 Q