3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <!DOCTYPE HTML> <html> <span class="unwrap_me"><i><span class="foo">Lorem</span></i><span class="foo">ipsum</span></span> </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); } }

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.5.10.0140.00719.69
8.5.00.0150.00720.31
8.4.150.0030.00014.05
8.4.140.0090.01117.83
8.4.130.0050.00417.89
8.4.120.0020.00720.70
8.4.110.0110.01122.63
8.4.100.0130.00517.95
8.4.90.0080.01218.80
8.4.80.0060.00218.04
8.4.70.0100.01117.96
8.4.60.0090.01124.36
8.4.50.0140.00718.66
8.4.40.0080.00020.95
8.4.30.0150.00324.04
8.4.20.0100.01018.02
8.4.10.0100.01024.05
8.3.280.0130.00721.09
8.3.270.0150.00616.72
8.3.260.0130.00916.86
8.3.250.0130.00518.87
8.3.240.0140.00517.24
8.3.230.0090.01016.92
8.3.220.0050.00317.23
8.3.210.0110.00818.78
8.3.200.0050.00516.93
8.3.190.0160.00117.46
8.3.180.0080.01316.84
8.3.170.0090.00917.43
8.3.160.0110.00718.48
8.3.150.0160.00318.50
8.3.140.0080.00017.38
8.3.130.0040.00418.60
8.3.120.0060.00321.09
8.3.110.0090.00020.94
8.3.100.0060.00324.06
8.3.90.0080.00026.77
8.3.80.0060.00317.97
8.3.70.0130.00316.75
8.3.60.0140.00717.00
8.3.50.0070.00716.81
8.3.40.0120.00320.42
8.3.30.0070.00719.02
8.3.20.0030.00524.18
8.3.10.0000.00824.66
8.3.00.0000.00826.16
8.2.290.0250.00618.77
8.2.280.0090.00818.61
8.2.270.0150.00417.31
8.2.260.0050.00316.98
8.2.250.0060.01216.84
8.2.240.0090.00617.42
8.2.230.0210.00718.53
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0080.00316.88
8.2.190.0130.00616.63
8.2.180.0170.00318.66
8.2.170.0150.00719.24
8.2.160.0030.01022.96
8.2.150.0080.00025.66
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0040.00419.66
8.2.110.0100.00022.35
8.2.100.0080.00418.09
8.2.90.0000.00818.16
8.2.80.0030.00519.23
8.2.70.0050.00517.82
8.2.60.0110.00717.50
8.2.50.0110.00717.63
8.2.40.0120.00417.62
8.2.30.0120.00617.50
8.2.20.0100.00717.63
8.2.10.0160.00017.63
8.2.00.0120.00417.61
8.1.330.0110.00821.73
8.1.320.0130.00816.51
8.1.310.0090.00020.61
8.1.300.0100.00617.88
8.1.290.0070.00730.84
8.1.280.0110.00725.92
8.1.270.0160.00324.66
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0090.00024.14
8.1.230.0090.00322.91
8.1.220.0000.00818.02
8.1.210.0090.00318.82
8.1.200.0030.00617.52
8.1.190.0110.00517.13
8.1.180.0120.00417.25
8.1.170.0100.00617.23
8.1.160.0080.00817.63
8.1.150.0110.00617.38
8.1.140.0150.00317.50
8.1.130.0120.00417.71
8.1.120.0140.00317.13
8.1.110.0130.00417.38
8.1.100.0170.00017.38
8.1.90.0160.00017.48
8.1.80.0110.00617.50
8.1.70.0130.00317.38
8.1.60.0090.00917.63
8.1.50.0160.00317.71
8.1.40.0130.00417.38
8.1.30.0130.00417.50
8.1.20.0140.00417.38
8.1.10.0160.00317.72
8.1.00.0140.00517.61
8.0.300.0000.00720.16
8.0.290.0030.00617.13
8.0.280.0170.00016.63
8.0.270.0100.00716.86
8.0.260.0050.01117.00
8.0.250.0130.00316.63
8.0.240.0170.00016.88
8.0.230.0170.00016.73
8.0.220.0040.01316.63
8.0.210.0130.00316.88
8.0.200.0160.00316.63
8.0.190.0080.00817.13
8.0.180.0140.00516.88
8.0.170.0130.00316.88
8.0.160.0170.00016.88
8.0.150.0130.00316.88
8.0.140.0080.00816.73
8.0.130.0080.00816.88
8.0.120.0130.00316.75
8.0.110.0140.00316.85
8.0.100.0160.00016.52
8.0.90.0170.00016.63
8.0.80.0130.00316.86
8.0.70.0090.00916.71
8.0.60.0060.01116.73
8.0.50.0140.00216.85
8.0.30.0070.01016.88
8.0.20.0100.00516.63
8.0.10.0140.00317.00

preferences:
38.81 ms | 403 KiB | 5 Q