3v4l.org

run code in 300+ PHP versions simultaneously
<?php function do_it($in) { $a = new DOMDocument(); $a->loadHTML($in); $xpath = new DOMXpath($a); foreach($xpath->query('/html/body//ul') as $node) _handle_uls($node); return $a->textContent; } function _handle_uls(DOMNode $node) { echo 'Works:' . "\n\n"; foreach ($node->childNodes as $subnode) echo '* ' . trim($subnode->textContent) . "\n"; echo "\n\n\n" . 'Problems:' . "\n\n"; foreach (iterator_to_array($node->childNodes) as $subnode) { $textNode = $subnode->ownerDocument->createTextNode('* ' . trim($subnode->textContent) . "\n"); $subnode->ownerDocument->importNode($textNode); $subnode->parentNode->replaceChild($textNode, $subnode); } } $HTML = '<ul><li>Potatoes</li><li>Tomatoes</li><li>Carrots</li></ul>'; echo do_it($HTML);

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.0130.00318.68
8.3.50.0120.00617.66
8.3.40.0060.00919.04
8.3.30.0090.00619.13
8.3.20.0000.00822.07
8.3.10.0040.00421.28
8.3.00.0040.00422.27
8.2.180.0180.00025.92
8.2.170.0150.00322.96
8.2.160.0110.00422.50
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0100.00019.77
8.2.100.0070.00418.22
8.2.90.0080.00018.41
8.2.80.0000.00917.97
8.2.70.0090.00018.41
8.2.60.0060.00318.32
8.2.50.0000.00819.50
8.2.40.0040.00421.39
8.2.30.0040.00420.82
8.2.20.0020.00518.46
8.2.10.0040.00419.28
8.2.00.0050.00318.54
8.1.280.0130.00325.92
8.1.270.0000.00821.08
8.1.260.0070.00026.35
8.1.250.0030.00628.09
8.1.240.0090.00022.67
8.1.230.0060.00621.47
8.1.220.0060.00318.15
8.1.210.0050.00319.35
8.1.200.0080.00017.72
8.1.190.0050.00317.63
8.1.180.0000.00818.10
8.1.170.0040.00418.98
8.1.160.0000.00719.22
8.1.150.0040.00419.32
8.1.140.0040.00420.59
8.1.130.0030.00320.67
8.1.120.0070.00017.95
8.1.110.0040.00417.80
8.1.100.0000.00817.89
8.1.90.0050.00217.91
8.1.80.0050.00317.77
8.1.70.0000.00817.89
8.1.60.0030.00518.05
8.1.50.0070.00317.82
8.1.40.0050.00317.86
8.1.30.0090.00018.13
8.1.20.0030.00618.02
8.1.10.0000.00818.02
8.1.00.0000.00717.83
8.0.300.0040.00420.40
8.0.290.0030.00617.25
8.0.280.0030.00318.81
8.0.270.0000.00717.59
8.0.260.0030.00518.89
8.0.250.0030.00317.32
8.0.240.0030.00517.47
8.0.230.0000.00717.38
8.0.220.0070.00017.37
8.0.210.0080.00017.41
8.0.200.0040.00417.48
8.0.190.0000.00717.31
8.0.180.0030.00517.39
8.0.170.0030.00617.44
8.0.160.0070.00017.37
8.0.150.0040.00417.24
8.0.140.0050.00317.21
8.0.130.0000.00713.80
8.0.120.0000.00817.33
8.0.110.0040.00417.29
8.0.100.0050.00317.40
8.0.90.0020.00517.34
8.0.80.0150.00017.32
8.0.70.0040.00417.25
8.0.60.0040.00417.37
8.0.50.0000.00717.22
8.0.30.0110.00517.59
8.0.20.0110.01517.20
8.0.10.0040.00417.48
8.0.00.0120.00817.21
7.4.330.0000.00615.55
7.4.320.0060.00016.77
7.4.300.0000.00716.86
7.4.290.0040.00416.98
7.4.280.0000.00816.86
7.4.270.0040.00417.08
7.4.260.0040.00416.83
7.4.250.0050.00316.79
7.4.240.0080.00016.91
7.4.230.0000.00716.84
7.4.220.0030.00316.77
7.4.210.0100.00616.96
7.4.200.0030.00316.77
7.4.160.0100.00816.86
7.4.140.0170.00717.86
7.4.130.0140.00316.83
7.4.120.0110.01317.08
7.4.110.0120.01217.01
7.4.100.0030.01317.05
7.4.90.0060.01017.11
7.4.80.0040.01519.39
7.4.70.0080.00816.79
7.4.60.0150.00616.77
7.4.50.0100.00716.74
7.4.40.0120.00616.98
7.4.00.0060.00615.01
7.3.330.0000.00513.55
7.3.320.0080.00013.43
7.3.310.0000.00716.66
7.3.300.0000.00716.55
7.3.290.0030.00316.46
7.3.280.0100.00516.64
7.3.260.0120.00616.75
7.3.230.0380.00916.95
7.3.210.0100.00716.70
7.3.200.0100.01016.88
7.3.190.0110.01116.71
7.3.180.0070.00917.02
7.3.170.0090.00716.85
7.3.160.0110.00516.81
7.3.50.0070.00714.47
7.3.40.0060.00814.90
7.3.30.0030.01414.88
7.3.20.1760.00614.92
7.3.10.0060.00814.87
7.3.00.0030.01015.01
7.2.330.0120.00917.15
7.2.320.0000.01717.11
7.2.310.0030.01516.89
7.2.300.0170.00717.09
7.2.290.0070.01517.29
7.2.180.0080.00814.94
7.2.170.0120.00015.05
7.2.160.0000.01215.12
7.2.150.0070.00715.11
7.2.140.0080.00615.20
7.2.130.0070.00715.27
7.2.120.0620.00315.38
7.2.110.0130.00615.21
7.2.100.0100.01015.40
7.2.90.0110.00315.43
7.2.80.0090.00615.28
7.2.70.0040.01115.33
7.2.60.0090.00615.19
7.2.50.0220.00315.34
7.2.40.0080.00815.09
7.2.30.0110.00615.39
7.2.20.0210.00615.29
7.2.10.0180.00915.23
7.2.00.0200.00315.09
7.1.280.0130.00614.04
7.1.270.0160.00613.93
7.1.260.0070.00713.99
7.1.250.0150.00913.98

preferences:
66.13 ms | 401 KiB | 5 Q