3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <!DOCTYPE HTML> <html> <body> <div></div> </body> </html> HTML; $dom = new DOMDocument(); $dom->loadHTML($html); $divs = iterator_to_array($dom->getElementsByTagName('div')->getIterator()); foreach ($divs as $div) { $fragment = $dom->createDocumentFragment(); $fragment->appendXML('<p>Hi!</p>'); $div->replaceWith(...$fragment->childNodes); }

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.4.130.0100.00817.87
8.4.120.0140.00622.45
8.4.110.0160.00522.90
8.4.100.0130.00817.95
8.4.90.0150.00618.87
8.4.80.0100.00817.93
8.4.70.0090.00317.89
8.4.60.0110.00818.99
8.4.50.0060.01020.52
8.4.40.0130.00720.83
8.4.30.0080.00022.56
8.4.20.0070.01419.93
8.4.10.0000.01024.05
8.3.260.0100.01117.02
8.3.250.0050.00319.04
8.3.240.0130.00716.80
8.3.230.0130.00916.94
8.3.220.0090.01017.52
8.3.210.0060.00317.00
8.3.200.0030.00616.98
8.3.190.0140.00817.34
8.3.180.0140.00618.45
8.3.170.0080.01119.17
8.3.160.0140.00416.99
8.3.150.0090.00619.17
8.3.140.0000.00818.58
8.3.130.0120.00818.63
8.3.120.0060.00321.12
8.3.110.0080.00020.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0030.00617.97
8.3.70.0130.00916.75
8.3.60.0120.00916.86
8.3.50.0140.00716.68
8.3.40.0130.00720.58
8.3.30.0090.00618.94
8.3.20.0000.00824.18
8.3.10.0050.00324.66
8.3.00.0110.00726.16
8.2.290.0100.00820.78
8.2.280.0100.00719.17
8.2.270.0040.01417.32
8.2.260.0030.00616.92
8.2.250.0100.00717.03
8.2.240.0090.00017.48
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0070.00426.77
8.2.200.0060.00316.88
8.2.190.0070.00718.92
8.2.180.0070.00716.75
8.2.170.0160.00319.18
8.2.160.0110.00322.96
8.2.150.0070.00725.66
8.2.140.0080.00024.66
8.2.130.0060.01226.16
8.2.120.0080.00020.00
8.2.110.0070.00322.29
8.2.100.0120.00017.97
8.2.90.0000.00818.16
8.2.80.0050.00322.50
8.2.70.0000.00817.88
8.2.60.0150.00317.50
8.2.50.0140.00517.63
8.2.40.0110.00517.75
8.2.30.0040.00417.88
8.2.20.0130.00417.50
8.2.10.0080.00817.88
8.2.00.0100.00617.75
8.1.330.0110.00822.26
8.1.320.0080.01116.46
8.1.310.0060.00318.16
8.1.300.0030.00618.71
8.1.290.0030.00630.84
8.1.280.0090.00625.92
8.1.270.0050.00324.66
8.1.260.0000.00826.35
8.1.250.0090.00928.09
8.1.240.0160.00020.88
8.1.230.0110.00022.41
8.1.220.0080.00017.89
8.1.210.0050.00518.97
8.1.200.0030.00517.73
8.1.190.0130.00317.00
8.1.180.0110.00517.50
8.1.170.0120.00417.50
8.1.160.0110.00617.38
8.1.150.0170.00317.13
8.1.140.0100.01017.38
8.1.130.0140.00517.25
8.1.120.0060.01117.36
8.1.110.0130.00317.34
8.1.100.0130.00317.24
8.1.90.0120.00417.38
8.1.80.0110.00717.60
8.1.70.0130.00317.25
8.1.60.0110.00717.50
8.1.50.0180.00017.50
8.1.40.0190.00017.63
8.1.30.0160.00817.23
8.1.20.0140.00517.75
8.1.10.0140.00317.37
8.1.00.0120.00517.63
8.0.300.0030.00620.15
8.0.290.0040.00416.88
8.0.280.0160.00016.88
8.0.270.0070.01016.88
8.0.260.0080.00816.75
8.0.250.0110.00517.13
8.0.240.0100.00617.00
8.0.230.0060.01116.88
8.0.220.0070.01016.75
8.0.210.0180.00016.63
8.0.200.0130.00716.88
8.0.190.0120.00416.88
8.0.180.0080.00816.86
8.0.170.0120.00416.88
8.0.160.0140.00317.13
8.0.150.0120.00416.75
8.0.140.0120.00416.88
8.0.130.0080.00817.00
8.0.120.0120.00516.52
8.0.110.0170.00016.86
8.0.100.0160.00016.87
8.0.90.0170.00416.63
8.0.80.0130.00317.00
8.0.70.0110.00516.99
8.0.60.0070.01116.88
8.0.50.0160.00016.63
8.0.30.0140.00317.00
8.0.20.0120.00416.75
8.0.10.0110.00516.86

preferences:
34.18 ms | 403 KiB | 5 Q