3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <!DOCTYPE HTML> <html> <body> <p><span class="unwrap_me">ipsum</span><span class="unwrap_me">dolor</span></p> </body> </html> HTML; $dom = new DOMDocument(); $dom->loadHTML($html); $spans = iterator_to_array($dom->getElementsByTagName('span')->getIterator()); foreach ($spans as $span) { if ('unwrap_me' === $span->getAttribute('class')) { $span->replaceWith(...$span->childNodes); } } echo $dom->saveHTML();

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.00420.54
8.4.120.0090.00818.11
8.4.110.0050.00419.79
8.4.100.0080.01317.55
8.4.90.0150.00521.02
8.4.80.0070.00819.24
8.4.70.0090.01218.24
8.4.60.0120.00818.94
8.4.50.0070.00220.48
8.4.40.0080.00020.89
8.4.30.0130.00622.39
8.4.20.0070.01017.89
8.4.10.0060.00324.12
8.3.260.0110.00816.83
8.3.250.0140.00616.75
8.3.240.0060.00516.93
8.3.230.0050.00318.82
8.3.220.0120.00719.09
8.3.210.0100.00816.82
8.3.200.0050.00317.06
8.3.190.0120.01117.29
8.3.180.0040.00421.21
8.3.170.0070.01119.13
8.3.160.0090.01017.57
8.3.150.0060.01217.23
8.3.140.0060.00316.77
8.3.130.0060.01216.64
8.3.120.0090.00921.07
8.3.110.0080.00016.74
8.3.100.0050.00324.06
8.3.90.0080.00026.77
8.3.80.0060.00317.97
8.3.70.0100.01017.00
8.3.60.0180.00316.73
8.3.50.0090.00618.50
8.3.40.0090.00620.20
8.3.30.0090.00618.92
8.3.20.0040.00424.18
8.3.10.0060.00324.66
8.3.00.0040.01426.16
8.2.290.0090.00817.09
8.2.280.0050.00420.79
8.2.270.0120.00619.15
8.2.260.0090.00916.75
8.2.250.0080.00018.77
8.2.240.0030.01417.42
8.2.230.0070.00320.94
8.2.220.0040.00437.54
8.2.210.0070.01126.77
8.2.200.0070.00317.13
8.2.190.0120.00316.73
8.2.180.0160.00318.68
8.2.170.0140.00019.20
8.2.160.0070.01122.96
8.2.150.0040.00425.66
8.2.140.0060.00324.66
8.2.130.0060.01226.16
8.2.120.0080.00019.91
8.2.110.0060.00322.39
8.2.100.0060.00619.70
8.2.90.0040.00417.88
8.2.80.0090.00019.03
8.2.70.0000.00817.75
8.2.60.0120.00617.50
8.2.50.0120.00417.63
8.2.40.0090.00717.37
8.2.30.0080.00817.38
8.2.20.0050.01017.50
8.2.10.0120.00317.75
8.2.00.0110.00417.63
8.1.330.0110.00816.43
8.1.320.0110.00816.54
8.1.310.0150.00316.88
8.1.300.0060.00318.75
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0080.00024.66
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0130.00424.09
8.1.230.0090.00319.22
8.1.220.0040.00417.91
8.1.210.0050.00318.77
8.1.200.0040.00417.48
8.1.190.0120.00317.25
8.1.180.0110.00417.50
8.1.170.0110.00417.38
8.1.160.0100.00717.25
8.1.150.0130.00517.35
8.1.140.0040.01217.50
8.1.130.0100.00617.50
8.1.120.0080.00817.63
8.1.110.0100.00517.48
8.1.100.0110.00517.48
8.1.90.0120.00417.50
8.1.80.0150.00017.50
8.1.70.0110.00417.71
8.1.60.0130.00317.63
8.1.50.0100.01017.63
8.1.40.0090.00917.63
8.1.30.0220.00217.50
8.1.20.0170.00017.75
8.1.10.0140.00217.48
8.1.00.0130.00517.50
8.0.300.0000.00818.77
8.0.290.0000.00816.88
8.0.280.0110.00516.84
8.0.270.0090.00716.85
8.0.260.0160.00017.00
8.0.250.0160.00016.88
8.0.240.0050.01016.85
8.0.230.0130.00416.75
8.0.220.0190.00016.52
8.0.210.0120.00416.52
8.0.200.0080.00816.75
8.0.190.0120.00416.63
8.0.180.0150.00016.63
8.0.170.0000.01516.85
8.0.160.0160.00016.63
8.0.150.0150.00216.75
8.0.140.0080.00816.75
8.0.130.0150.00016.59
8.0.120.0120.00616.84
8.0.110.0130.00316.52
8.0.100.0130.00416.73
8.0.90.0120.00416.88
8.0.80.0160.00016.75
8.0.70.0080.00816.75
8.0.60.0110.00516.71
8.0.50.0120.00416.52
8.0.30.0160.00016.60
8.0.20.0130.00316.72
8.0.10.0170.00016.75

preferences:
61.89 ms | 403 KiB | 5 Q