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->nodeName); 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.60.0150.00418.68
8.3.50.0090.01117.75
8.3.40.0130.00919.09
8.3.30.0070.00718.86
8.3.20.0080.00024.02
8.3.10.0080.00021.15
8.3.00.0000.00822.26
8.2.180.0090.00925.92
8.2.170.0060.00922.96
8.2.160.0100.00322.63
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00326.16
8.2.110.0070.00321.39
8.2.100.0040.00819.23
8.2.90.0000.00917.87
8.2.80.0030.00817.97
8.2.70.0000.00818.28
8.2.60.0040.00418.28
8.2.50.0000.00819.62
8.2.40.0000.00821.40
8.2.30.0030.00520.84
8.2.20.0030.00518.36
8.2.10.0040.00419.30
8.2.00.0070.00018.46
8.1.280.0060.00925.92
8.1.270.0060.00320.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0130.00921.02
8.1.230.0040.00819.33
8.1.220.0040.00718.03
8.1.210.0000.00818.77
8.1.200.0050.00517.61
8.1.190.0080.00017.60
8.1.180.0080.00318.10
8.1.170.0080.00018.87
8.1.160.0040.00419.21
8.1.150.0040.00419.27
8.1.140.0040.00420.64
8.1.130.0050.00220.54
8.1.120.0000.00817.83
8.1.110.0040.00417.70
8.1.100.0070.00017.87
8.1.90.0000.00817.74
8.1.80.0030.00517.87
8.1.70.0000.00717.75
8.1.60.0040.00417.90
8.1.50.0030.00817.87
8.1.40.0030.00617.79
8.1.30.0040.00418.06
8.1.20.0040.00417.88
8.1.10.0040.00418.02
8.1.00.0050.00217.91
8.0.300.0070.00019.93
8.0.290.0080.00016.88
8.0.280.0080.00018.77
8.0.270.0040.00417.55
8.0.260.0030.00318.76
8.0.250.0030.00317.26
8.0.240.0000.00717.32
8.0.230.0000.00717.32
8.0.220.0000.00717.26
8.0.210.0040.00417.36
8.0.200.0080.00017.42
8.0.190.0080.00017.30
8.0.180.0040.00417.40
8.0.170.0000.00917.35
8.0.160.0050.00317.23
8.0.150.0070.00017.36
8.0.140.0070.00017.34
8.0.130.0070.00013.68
8.0.120.0040.00417.34
8.0.110.0000.00817.27
8.0.100.0080.00017.34
8.0.90.0000.00717.25
8.0.80.0030.01317.34
8.0.70.0050.00317.26
8.0.60.0050.00317.25
8.0.50.0050.00217.23
8.0.30.0130.00617.63
8.0.20.0190.00317.47
8.0.10.0000.00817.54
8.0.00.0080.01117.16
7.4.330.0000.00515.55
7.4.320.0030.00316.84
7.4.300.0030.00317.05
7.4.290.0040.00416.98
7.4.280.0040.00417.04
7.4.270.0040.00416.93
7.4.260.0040.00417.02
7.4.250.0000.00716.95
7.4.240.0070.00016.97
7.4.230.0000.00717.06
7.4.220.0040.00417.02
7.4.210.0070.00816.93
7.4.200.0050.00317.06
7.4.160.0130.00616.89
7.4.140.0160.01017.86
7.4.130.0130.01017.04
7.4.120.0060.01217.02
7.4.110.0140.00716.90
7.4.100.0030.01516.79
7.4.90.0030.01716.94
7.4.80.0030.01419.39
7.4.70.0030.01416.70
7.4.60.0110.01116.99
7.4.50.0060.00616.70
7.4.40.0080.01116.79
7.4.00.0090.00615.20
7.3.330.0000.00513.52
7.3.320.0050.00313.39
7.3.310.0000.00816.64
7.3.300.0040.00416.64
7.3.290.0070.00016.61
7.3.280.0110.01016.61
7.3.260.0100.00916.77
7.3.240.0120.00716.76
7.3.230.0150.00316.74
7.3.210.0110.00716.98
7.3.200.0160.00316.67
7.3.190.0100.00716.69
7.3.180.0080.00816.86
7.3.170.0090.00616.75
7.3.160.0100.01016.61
7.3.50.0060.00814.75
7.3.40.0180.00614.95
7.3.30.0030.00714.89
7.3.20.0100.00314.92
7.3.10.0110.00414.85
7.3.00.0070.00714.66
7.2.330.0100.00717.25
7.2.320.0070.01017.02
7.2.310.0090.00917.26
7.2.300.0060.01217.16
7.2.290.0110.00517.16
7.2.180.0030.01115.06
7.2.170.0060.01115.21
7.2.160.0160.00615.06
7.2.150.0090.00615.09
7.2.140.0100.00315.30
7.2.130.0060.01215.19
7.2.120.0070.00715.09
7.2.110.0080.00515.25
7.2.100.0160.00615.05
7.2.90.0150.00615.25
7.2.80.0180.00015.36
7.2.70.0170.00015.39
7.2.60.0100.00715.34
7.2.50.0150.00915.27
7.2.40.0230.00315.11
7.2.30.0130.00315.20
7.2.20.0100.01315.03
7.2.10.0220.00415.23
7.2.00.0220.00315.30
7.1.280.0080.00814.18
7.1.270.0060.00814.02
7.1.260.0930.00613.81
7.1.250.0060.00614.09

preferences:
76.99 ms | 401 KiB | 5 Q