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"; var_dump($node); foreach ($node->childNodes as $subnode) { var_dump($subnode->nodeName); $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.70.0160.00616.88
8.3.60.0120.00918.93
8.3.50.0150.00317.77
8.3.40.0100.00719.22
8.3.30.0110.00419.07
8.3.20.0000.00824.02
8.3.10.0080.00021.27
8.3.00.0090.00022.15
8.2.190.0210.00317.00
8.2.180.0070.00725.92
8.2.170.0070.00722.96
8.2.160.0140.00022.64
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0100.00021.40
8.2.100.0150.00018.15
8.2.90.0040.00419.55
8.2.80.0000.00819.73
8.2.70.0040.00417.88
8.2.60.0000.01017.88
8.2.50.0090.00018.13
8.2.40.0040.00418.28
8.2.30.0000.00820.93
8.2.20.0030.00618.41
8.2.10.0030.00619.34
8.2.00.0050.00318.50
8.1.280.0120.00325.92
8.1.270.0080.00021.12
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.47
8.1.230.0040.00819.39
8.1.220.0000.00818.04
8.1.210.0040.00418.77
8.1.200.0030.00717.60
8.1.190.0000.00817.48
8.1.180.0080.00018.10
8.1.170.0000.00917.72
8.1.160.0000.00719.38
8.1.150.0000.00819.19
8.1.140.0000.00720.75
8.1.130.0000.00720.55
8.1.120.0040.00417.87
8.1.110.0070.00017.75
8.1.100.0050.00317.77
8.1.90.0050.00317.87
8.1.80.0050.00317.84
8.1.70.0040.00417.65
8.1.60.0060.00317.95
8.1.50.0070.00317.93
8.1.40.0050.00517.96
8.1.30.0060.00318.05
8.1.20.0000.00818.09
8.1.10.0080.00017.96
8.1.00.0050.00317.75
8.0.300.0050.00318.77
8.0.290.0080.00017.00
8.0.280.0040.00418.73
8.0.270.0000.00717.55
8.0.260.0030.00318.73
8.0.250.0030.00317.40
8.0.240.0030.00317.41
8.0.230.0040.00417.22
8.0.220.0030.00317.37
8.0.210.0050.00317.26
8.0.200.0040.00417.27
8.0.190.0050.00517.28
8.0.180.0000.00717.23
8.0.170.0050.00317.36
8.0.160.0040.00417.24
8.0.150.0050.00217.27
8.0.140.0040.00417.18
8.0.130.0040.00413.82
8.0.120.0030.00617.18
8.0.110.0030.00517.39
8.0.100.0000.00817.39
8.0.90.0040.00417.24
8.0.80.0120.00317.44
8.0.70.0040.00417.21
8.0.60.0030.00517.38
8.0.50.0070.00017.24
8.0.30.0150.00317.55
8.0.20.0230.00617.41
8.0.10.0000.00717.34
8.0.00.0120.00817.20
7.4.330.0050.00015.55
7.4.320.0060.00016.93
7.4.300.0000.00616.94
7.4.290.0040.00416.95
7.4.280.0050.00516.89
7.4.270.0080.00016.73
7.4.260.0040.00416.88
7.4.250.0070.00016.89
7.4.240.0060.00316.92
7.4.230.0030.00316.93
7.4.220.0000.00817.07
7.4.210.0090.00816.96
7.4.200.0030.00316.75
7.4.160.0080.00816.88
7.4.140.0120.01217.86
7.4.130.0080.01416.87
7.4.120.0150.00316.66
7.4.110.0130.00816.86
7.4.100.0090.01516.68
7.4.90.0200.00316.76
7.4.80.0120.00819.39
7.4.70.0140.00416.92
7.4.60.0120.00617.09
7.4.50.0070.00716.91
7.4.40.0080.01016.93
7.4.00.0000.01514.99
7.3.330.0000.00613.56
7.3.320.0070.00013.59
7.3.310.0030.00516.76
7.3.300.0040.00416.64
7.3.290.0000.00816.69
7.3.280.0150.00716.64
7.3.260.0100.00916.76
7.3.240.0080.01016.79
7.3.230.0080.01116.73
7.3.210.0090.01516.73
7.3.200.0090.01216.82
7.3.190.0040.01216.64
7.3.180.0100.00716.79
7.3.170.0070.01016.79
7.3.160.0080.01116.91
7.3.120.0080.00415.07
7.3.110.0000.01314.83
7.3.100.0090.00615.03
7.3.90.0080.00014.73
7.3.80.0100.00315.17
7.3.70.0170.00014.97
7.3.60.0040.01115.14
7.3.50.0120.01014.91
7.3.40.0100.01114.80
7.3.30.0050.00714.83
7.3.20.0090.00915.90
7.3.10.0150.00715.79
7.3.00.0110.00815.79
7.2.330.0100.01017.30
7.2.320.0120.00616.87
7.2.310.0160.00316.94
7.2.300.0090.00916.85
7.2.290.0140.00617.25
7.2.240.0030.01015.55
7.2.230.0030.00914.90
7.2.220.0060.00915.11
7.2.210.0090.00615.57
7.2.200.0030.01615.36
7.2.190.0100.00315.18
7.2.180.0100.01215.01
7.2.170.0130.00815.32
7.2.160.0080.01015.15
7.2.150.0120.00816.16
7.2.140.0050.01616.17
7.2.130.0110.00516.08
7.2.120.0110.00716.16
7.2.110.0100.00715.99
7.2.100.0140.00916.17
7.2.90.0180.00516.29
7.2.80.0130.01416.13
7.2.70.0160.00316.10
7.2.60.0080.01016.06
7.2.50.0130.00616.18
7.2.40.0130.00716.23
7.2.30.0120.01016.25
7.2.20.0080.01216.17
7.2.10.0110.01116.15
7.2.00.0100.01016.20
7.1.330.0070.00715.99
7.1.320.0030.01315.96
7.1.310.0030.01015.98
7.1.300.0000.01515.91
7.1.290.0080.00315.98
7.1.280.0440.01114.82
7.1.270.0060.00614.92
7.1.260.0090.00814.89
7.1.250.0060.01014.80

preferences:
54.22 ms | 401 KiB | 5 Q