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) { 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.00718.80
8.3.50.0080.01117.55
8.3.40.0030.01219.01
8.3.30.0070.01018.96
8.3.20.0070.00022.10
8.3.10.0050.00321.32
8.3.00.0040.00422.23
8.2.180.0140.00425.92
8.2.170.0180.00022.96
8.2.160.0140.00022.63
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0100.00021.61
8.2.100.0080.00418.09
8.2.90.0000.00820.80
8.2.80.0080.00020.02
8.2.70.0030.00518.00
8.2.60.0000.00817.88
8.2.50.0090.00018.41
8.2.40.0040.00418.30
8.2.30.0040.00418.36
8.2.20.0040.00418.36
8.2.10.0040.00419.28
8.2.00.0000.00818.47
8.1.280.0110.00425.92
8.1.270.0080.00021.13
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.86
8.1.230.0090.00321.35
8.1.220.0060.00318.13
8.1.210.0050.00519.22
8.1.200.0060.00617.60
8.1.190.0050.00317.61
8.1.180.0000.00818.10
8.1.170.0000.00818.16
8.1.160.0030.00519.28
8.1.150.0040.00419.23
8.1.140.0030.00520.61
8.1.130.0070.00020.60
8.1.120.0040.00417.90
8.1.110.0050.00217.80
8.1.100.0040.00417.89
8.1.90.0070.00017.89
8.1.80.0040.00417.86
8.1.70.0000.00717.81
8.1.60.0040.00418.00
8.1.50.0070.00317.79
8.1.40.0040.00417.79
8.1.30.0040.00418.05
8.1.20.0030.00618.09
8.1.10.0040.00417.98
8.1.00.0030.00617.93
8.0.300.0040.00420.23
8.0.290.0000.00817.13
8.0.280.0050.00318.91
8.0.270.0000.00717.60
8.0.260.0030.00318.78
8.0.250.0000.00717.41
8.0.240.0090.00017.41
8.0.230.0030.00317.30
8.0.220.0070.00017.30
8.0.210.0070.00017.19
8.0.200.0000.00717.38
8.0.190.0070.00017.21
8.0.180.0090.00017.29
8.0.170.0030.00617.43
8.0.160.0000.00817.35
8.0.150.0040.00417.18
8.0.140.0040.00417.30
8.0.130.0000.00613.70
8.0.120.0060.00317.14
8.0.110.0040.00417.27
8.0.100.0040.00417.20
8.0.90.0050.00317.06
8.0.80.0190.00317.36
8.0.70.0040.00417.24
8.0.60.0040.00417.38
8.0.50.0000.00717.48
8.0.30.0080.01117.68
8.0.20.0180.00717.76
8.0.10.0000.00817.30
8.0.00.0140.00717.22
7.4.330.0030.00315.55
7.4.320.0030.00317.02
7.4.300.0000.00616.88
7.4.290.0020.00516.82
7.4.280.0080.00017.03
7.4.270.0000.00716.70
7.4.260.0080.00016.90
7.4.250.0070.00017.00
7.4.240.0030.00616.98
7.4.230.0040.00317.00
7.4.220.0040.00416.84
7.4.210.0080.00716.90
7.4.200.0030.00316.68
7.4.160.0080.01016.83
7.4.140.0170.00017.86
7.4.130.0120.00616.91
7.4.120.0130.00716.87
7.4.110.0070.01116.70
7.4.100.0070.01017.11
7.4.90.0060.01116.93
7.4.80.0140.00419.39
7.4.70.0090.00916.79
7.4.60.0100.00716.73
7.4.50.0040.01216.58
7.4.40.0130.00316.77
7.4.00.0100.00615.13
7.3.330.0000.00513.55
7.3.320.0030.00613.55
7.3.310.0040.00416.47
7.3.300.0040.00416.61
7.3.290.0000.00816.51
7.3.280.0070.01016.56
7.3.260.0140.01016.75
7.3.230.0060.01116.57
7.3.210.0120.00616.82
7.3.200.0090.00916.70
7.3.190.0060.00916.86
7.3.180.0060.00916.60
7.3.170.0110.00716.95
7.3.160.0080.00816.60
7.3.50.0100.00314.86
7.3.40.0060.00614.68
7.3.30.0040.00814.84
7.3.20.0100.01614.53
7.3.10.0040.01214.70
7.3.00.0120.00614.84
7.2.330.0110.00716.80
7.2.320.0090.00917.22
7.2.310.0060.01216.84
7.2.300.0030.01517.06
7.2.290.0060.01016.86
7.2.180.0060.00915.12
7.2.170.0040.01115.21
7.2.160.0090.00314.94
7.2.150.0250.00315.18
7.2.140.0080.00715.27
7.2.130.0100.01315.42
7.2.120.0070.01015.16
7.2.110.0180.00615.36
7.2.100.0160.01015.07
7.2.90.0070.01015.42
7.2.80.1060.00715.13
7.2.70.0030.01215.13
7.2.60.0180.00915.15
7.2.50.0060.01015.17
7.2.40.0230.00315.38
7.2.30.0190.00615.48
7.2.20.0140.01015.18
7.2.10.0040.01114.98
7.2.00.0330.00315.27
7.1.280.0130.00014.06
7.1.270.0100.00314.13
7.1.260.0060.00613.93
7.1.250.0120.01213.99

preferences:
57.98 ms | 401 KiB | 5 Q