3v4l.org

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

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.0140.00718.11
8.4.120.0100.01024.22
8.4.110.0120.00921.50
8.4.100.0050.00719.27
8.4.90.0120.00918.91
8.4.80.0050.00518.89
8.4.70.0090.00418.07
8.4.60.0110.01019.15
8.4.50.0110.00918.83
8.4.40.0030.00621.00
8.4.30.0150.00322.66
8.4.20.0100.01017.98
8.4.10.0090.00023.81
8.3.260.0110.00917.53
8.3.250.0140.00518.93
8.3.240.0110.00917.33
8.3.230.0110.00816.79
8.3.220.0050.00319.28
8.3.210.0100.00816.97
8.3.200.0080.00117.04
8.3.190.0100.00617.39
8.3.180.0110.01017.54
8.3.170.0090.00922.96
8.3.160.0120.00617.23
8.3.150.0160.00316.57
8.3.140.0090.00920.93
8.3.130.0080.00018.70
8.3.120.0030.00620.95
8.3.110.0100.00020.94
8.3.100.0000.00924.06
8.3.90.0040.01126.77
8.3.80.0060.00318.81
8.3.70.0120.00918.56
8.3.60.0040.01116.73
8.3.50.0110.00716.67
8.3.40.0110.00320.47
8.3.30.0120.00318.92
8.3.20.0180.00024.18
8.3.10.0060.00324.66
8.3.00.0000.00826.16
8.2.290.0120.00620.74
8.2.280.0160.00518.59
8.2.270.0150.00417.11
8.2.260.0150.00417.06
8.2.250.0110.00718.75
8.2.240.0090.00019.24
8.2.230.0060.00322.58
8.2.220.0030.00537.54
8.2.210.0030.00526.77
8.2.200.0000.01018.42
8.2.190.0070.00716.75
8.2.180.0090.00617.00
8.2.170.0110.01119.09
8.2.160.0090.00922.96
8.2.150.0140.00325.66
8.2.140.0070.00024.66
8.2.130.0030.00526.16
8.2.120.0050.00319.89
8.2.110.0060.00320.76
8.2.100.0000.01217.97
8.2.90.0030.00617.63
8.2.80.0000.00819.09
8.2.70.0040.00417.75
8.2.60.0120.00617.74
8.2.50.0080.00817.63
8.2.40.0120.00417.38
8.2.30.0110.00517.63
8.2.20.0140.00317.75
8.2.10.0130.00417.63
8.2.00.0080.00817.84
8.1.330.0090.01022.13
8.1.320.0100.00916.30
8.1.310.0060.00916.23
8.1.300.0100.00616.06
8.1.290.0100.00030.84
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0110.00426.35
8.1.250.0030.00528.09
8.1.240.0080.00422.20
8.1.230.0080.00421.13
8.1.220.0000.00817.91
8.1.210.0040.00418.77
8.1.200.0040.00417.60
8.1.190.0180.00017.25
8.1.180.0150.00017.35
8.1.170.0120.00417.36
8.1.160.0140.00317.11
8.1.150.0100.00517.50
8.1.140.0170.00017.21
8.1.130.0150.00617.50
8.1.120.0070.01117.50
8.1.110.0100.00517.50
8.1.100.0120.00417.22
8.1.90.0150.00017.38
8.1.80.0130.00317.46
8.1.70.0150.00017.63
8.1.60.0120.00417.75
8.1.50.0140.00517.38
8.1.40.0110.00617.63
8.1.30.0140.00317.72
8.1.20.0120.00817.47
8.1.10.0110.00617.63
8.1.00.0170.00017.38
8.0.300.0040.00418.77
8.0.290.0000.00816.88
8.0.280.0060.01116.63
8.0.270.0130.00416.75
8.0.260.0120.00416.52
8.0.250.0150.00016.87
8.0.240.0110.00516.84
8.0.230.0160.00016.52
8.0.220.0100.00716.62
8.0.210.0100.00516.75
8.0.200.0110.00516.75
8.0.190.0140.00616.52
8.0.180.0110.00716.88
8.0.170.0160.00016.75
8.0.160.0120.00416.73
8.0.150.0110.00616.63
8.0.140.0160.00016.74
8.0.130.0060.00916.88
8.0.120.0110.00416.52
8.0.110.0130.00316.52
8.0.100.0110.00416.63
8.0.90.0040.01216.59
8.0.80.0120.00416.62
8.0.70.0120.00416.52
8.0.60.0120.00416.52
8.0.50.0160.00016.52
8.0.30.0100.00516.52
8.0.20.0120.00416.52
8.0.10.0080.00816.62

preferences:
37.21 ms | 403 KiB | 5 Q