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: <ul><li>Green carrots</li><li>Yellow carrots</li></ul></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.0120.00618.80
8.3.50.0110.00917.71
8.3.40.0060.00919.04
8.3.30.0090.00619.04
8.3.20.0080.00022.28
8.3.10.0080.00021.23
8.3.00.0040.00422.26
8.2.180.0110.00425.92
8.2.170.0170.00322.96
8.2.160.0120.00322.63
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00421.44
8.2.110.0030.00619.52
8.2.100.0030.00917.86
8.2.90.0030.00618.22
8.2.80.0060.00318.00
8.2.70.0040.00418.18
8.2.60.0000.00818.37
8.2.50.0000.00719.66
8.2.40.0080.00021.52
8.2.30.0040.00420.99
8.2.20.0040.00418.52
8.2.10.0000.00719.39
8.2.00.0090.00018.46
8.1.280.0130.00625.92
8.1.270.0080.00021.13
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00324.27
8.1.230.0070.00321.29
8.1.220.0070.00318.16
8.1.210.0000.00819.24
8.1.200.0030.00617.72
8.1.190.0080.00017.73
8.1.180.0030.00518.10
8.1.170.0030.00619.02
8.1.160.0000.00719.26
8.1.150.0040.00419.17
8.1.140.0050.00220.55
8.1.130.0000.00920.63
8.1.120.0000.00817.75
8.1.110.0030.00617.81
8.1.100.0000.00717.75
8.1.90.0050.00317.80
8.1.80.0050.00217.85
8.1.70.0040.00417.76
8.1.60.0040.00417.97
8.1.50.0060.00317.80
8.1.40.0000.00817.78
8.1.30.0050.00318.10
8.1.20.0050.00318.01
8.1.10.0000.00818.01
8.1.00.0050.00317.91
8.0.300.0080.00020.55
8.0.290.0060.00317.25
8.0.280.0080.00018.72
8.0.270.0040.00417.64
8.0.260.0030.00518.83
8.0.250.0050.00317.29
8.0.240.0000.00917.45
8.0.230.0040.00417.34
8.0.220.0000.00717.30
8.0.210.0000.00717.33
8.0.200.0030.00317.45
8.0.190.0040.00417.29
8.0.180.0040.00417.39
8.0.170.0000.00817.41
8.0.160.0040.00417.28
8.0.150.0070.00017.31
8.0.140.0030.00517.31
8.0.130.0030.00313.88
8.0.120.0060.00317.36
8.0.110.0000.00817.20
8.0.100.0000.00717.29
8.0.90.0040.00417.49
8.0.80.0110.00417.38
8.0.70.0040.00417.29
8.0.60.0000.00717.07
8.0.50.0050.00217.28
8.0.30.0120.00717.61
8.0.20.0140.01117.86
8.0.10.0000.00817.52
8.0.00.0120.00717.18
7.4.330.0000.00515.55
7.4.320.0030.00316.97
7.4.300.0070.00016.95
7.4.290.0080.00016.83
7.4.280.0050.00316.87
7.4.270.0000.00816.85
7.4.260.0060.00316.89
7.4.250.0000.00716.98
7.4.240.0000.00816.91
7.4.230.0000.00716.66
7.4.220.0040.00417.07
7.4.210.0070.01016.98
7.4.200.0040.00417.07
7.4.160.0070.01116.85
7.4.140.0090.00917.86
7.4.130.0120.00617.21
7.4.120.0070.01516.74
7.4.110.0090.00916.79
7.4.100.0030.01516.89
7.4.90.0140.00316.88
7.4.80.0150.00719.39
7.4.70.0070.02116.89
7.4.60.0060.01016.90
7.4.50.0070.00716.87
7.4.40.0080.00916.77
7.4.10.0120.00715.18
7.4.00.0090.00815.20
7.3.330.0060.00013.63
7.3.320.0030.00413.39
7.3.310.0040.00416.45
7.3.300.0000.00716.51
7.3.290.0070.00016.59
7.3.280.0050.01116.60
7.3.260.0130.00716.78
7.3.230.0130.00316.70
7.3.210.0120.00616.95
7.3.200.0090.00916.86
7.3.190.0100.00716.80
7.3.180.0100.00716.58
7.3.170.0110.01116.86
7.3.160.0130.00316.75
7.3.130.0040.01115.09
7.3.120.0050.01114.85
7.3.110.0110.00515.04
7.3.100.0060.00915.00
7.3.90.0060.00915.03
7.3.80.0060.01014.77
7.3.70.0080.00614.89
7.3.60.0110.00514.94
7.3.50.0040.01314.81
7.3.40.0090.00414.91
7.3.30.0080.00614.90
7.3.20.0070.00816.21
7.3.10.0080.00816.23
7.3.00.0060.00816.32
7.2.330.0130.01017.14
7.2.320.0100.00717.11
7.2.310.0070.01416.91
7.2.300.0050.01217.14
7.2.290.0060.01117.08
7.2.260.0100.00715.34
7.2.250.0120.00515.19
7.2.240.0050.00915.26
7.2.230.0100.00815.27
7.2.220.0050.01115.35
7.2.210.0060.01115.34
7.2.200.0050.00915.14
7.2.190.0050.00915.31
7.2.180.0060.00815.22
7.2.170.0070.00815.17
7.2.160.0040.00915.14
7.2.150.0110.00416.56
7.2.140.0110.00716.63
7.2.130.0110.00516.46
7.2.120.0100.00716.64
7.2.110.0050.00916.53
7.2.100.0100.00316.62
7.2.90.0100.00416.57
7.2.80.0090.00816.74
7.2.70.0060.01016.56
7.2.60.0060.00816.66
7.2.50.0090.00716.61
7.2.40.0080.00816.75
7.2.30.0070.01116.73
7.2.20.0060.00616.57
7.2.10.0250.01016.73
7.2.00.0070.00916.68
7.1.330.0090.00515.82
7.1.320.0040.01015.91
7.1.310.0040.01016.13
7.1.300.0040.01015.90
7.1.290.0040.01015.90
7.1.280.0080.00515.50
7.1.270.0070.00815.48
7.1.260.0050.00915.46
7.1.250.0070.00515.57
7.1.240.0030.01016.05
7.1.230.0090.00315.80
7.1.220.0050.00615.99
7.1.210.0050.00815.84
7.1.200.0050.00915.84
7.1.190.0020.01115.91
7.1.180.0080.00715.89
7.1.170.0050.00815.91
7.1.160.0060.00915.98
7.1.150.0100.00615.82
7.1.140.0010.01015.83
7.1.130.0030.01215.88
7.1.120.0100.00515.82
7.1.110.0090.00316.01
7.1.100.0100.00515.89
7.1.90.0030.01115.90
7.1.80.0040.00915.89
7.1.70.0050.01115.81
7.1.60.0060.00715.87
7.1.50.0060.00815.84
7.1.40.0030.00915.85
7.1.30.0000.01615.79
7.1.20.0040.01115.78
7.1.10.0050.00415.90
7.1.00.0070.00616.03

preferences:
34.42 ms | 401 KiB | 5 Q