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 ($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.0090.00618.68
8.3.50.0140.00717.64
8.3.40.0040.01119.00
8.3.30.0030.01219.11
8.3.20.0080.00022.23
8.3.10.0060.00321.28
8.3.00.0000.00822.14
8.2.180.0040.01125.92
8.2.170.0120.00322.96
8.2.160.0100.00322.58
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00826.16
8.2.110.0070.00419.75
8.2.100.0040.00818.09
8.2.90.0030.00618.34
8.2.80.0000.00918.00
8.2.70.0040.00418.30
8.2.60.0030.00618.59
8.2.50.0050.00319.58
8.2.40.0000.00819.67
8.2.30.0000.00820.84
8.2.20.0030.00618.43
8.2.10.0040.00419.27
8.2.00.0000.00718.46
8.1.280.0120.00325.92
8.1.270.0030.00621.21
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0090.00019.71
8.1.230.0040.00721.39
8.1.220.0060.00318.03
8.1.210.0000.00819.41
8.1.200.0030.00617.86
8.1.190.0000.00817.73
8.1.180.0080.00018.10
8.1.170.0030.00619.04
8.1.160.0050.00319.22
8.1.150.0030.00519.21
8.1.140.0000.00720.67
8.1.130.0000.00717.96
8.1.120.0000.00717.88
8.1.110.0050.00317.74
8.1.100.0070.00017.77
8.1.90.0000.00917.91
8.1.80.0000.00817.77
8.1.70.0050.00317.91
8.1.60.0000.00818.00
8.1.50.0040.00817.78
8.1.40.0080.00017.95
8.1.30.0030.00518.03
8.1.20.0000.00817.96
8.1.10.0040.00417.92
8.1.00.0040.00417.95
8.0.300.0060.00320.53
8.0.290.0030.00617.38
8.0.280.0000.00718.80
8.0.270.0040.00417.61
8.0.260.0030.00317.25
8.0.250.0000.00817.38
8.0.240.0060.00017.36
8.0.230.0030.00317.41
8.0.220.0000.00717.41
8.0.210.0000.00717.29
8.0.200.0000.00717.27
8.0.190.0040.00417.43
8.0.180.0000.00717.26
8.0.170.0000.00817.42
8.0.160.0040.00417.41
8.0.150.0000.00717.33
8.0.140.0050.00217.33
8.0.130.0030.00313.85
8.0.120.0000.00817.32
8.0.110.0000.00817.25
8.0.100.0050.00317.35
8.0.90.0040.00417.40
8.0.80.0070.00717.43
8.0.70.0000.00817.31
8.0.60.0040.00417.23
8.0.50.0000.00817.23
8.0.30.0120.00717.53
8.0.20.0100.01017.50
8.0.10.0040.00417.38
8.0.00.0090.01017.08
7.4.330.0060.00015.55
7.4.320.0040.00417.03
7.4.300.0000.00617.02
7.4.290.0030.00617.02
7.4.280.0040.00416.96
7.4.270.0100.00017.03
7.4.260.0000.00816.91
7.4.250.0070.00016.92
7.4.240.0030.00516.96
7.4.230.0070.00016.77
7.4.220.0050.00317.05
7.4.210.0050.01216.93
7.4.200.0080.00016.68
7.4.140.0100.01017.86
7.4.130.0120.00616.98
7.4.120.0140.00317.15
7.4.110.0120.00616.90
7.4.100.0110.01216.94
7.4.90.0070.01116.88
7.4.80.0180.00919.39
7.4.70.0110.00516.94
7.4.60.0100.00716.97
7.4.50.0040.01116.85
7.4.40.0130.00316.85
7.4.00.0000.01815.46
7.3.330.0000.00513.58
7.3.320.0060.00313.54
7.3.310.0070.00016.58
7.3.300.0070.00016.63
7.3.290.0000.00716.61
7.3.280.0170.00516.67
7.3.260.0110.00916.85
7.3.240.0070.01016.80
7.3.230.0130.00316.93
7.3.210.0000.02016.88
7.3.200.0100.00716.61
7.3.190.0000.01816.64
7.3.180.0040.01316.90
7.3.170.0120.00917.01
7.3.160.0000.01716.71
7.3.50.0100.00314.73
7.3.40.0070.00414.93
7.3.30.0040.01114.87
7.3.20.0090.00316.63
7.3.10.0200.00316.66
7.3.00.0030.01816.61
7.2.330.0080.01116.87
7.2.320.0100.01017.20
7.2.310.0090.00917.26
7.2.300.0070.01116.80
7.2.290.0060.01317.07
7.2.180.0070.00414.90
7.2.170.0050.00715.15
7.2.160.0060.00914.93
7.2.150.0070.00416.84
7.2.140.0120.00917.12
7.2.130.0110.00316.72
7.2.120.0040.00817.10
7.2.110.0060.00617.03
7.2.100.0000.01116.86
7.2.90.0070.00417.13
7.2.80.0060.00617.13
7.2.70.0090.01517.12
7.2.60.0090.00917.16
7.2.50.0060.00817.08
7.2.40.0080.00817.05
7.2.30.0090.01217.07
7.2.20.0030.02017.00
7.2.10.0040.01116.93
7.2.00.0030.00917.16
7.1.280.0040.00816.00
7.1.270.0090.00615.93
7.1.260.0060.00615.71
7.1.250.0050.00515.91

preferences:
67.32 ms | 401 KiB | 5 Q