3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<HTML <!doctype html> <html> <body> text to keep <span xxx="xxxx"><span xxx="xxx">unwanted text</span> unwanted text </span> text to keep </body> </html> HTML; $doc = new DOMDocument(); $doc->loadHTML($str); $xpath = new DOMXPath($doc); foreach($xpath->evaluate("//span") as $node) { echo 'Removing: '.$node->nodeValue."<br>"; $node->parentNode->removeChild($node); } $output = $doc->saveHTML(); echo htmlspecialchars($output);

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.120.0090.01024.36
8.4.110.0090.00719.08
8.4.100.0070.00318.07
8.4.90.0130.00719.77
8.4.80.0060.00318.10
8.4.70.0120.00918.11
8.4.60.0110.01019.23
8.4.50.0130.00819.02
8.4.40.0100.01319.89
8.4.30.0090.00919.19
8.4.20.0030.01720.64
8.4.10.0090.00018.94
8.3.250.0120.00719.40
8.3.240.0040.00517.61
8.3.230.0140.00616.96
8.3.220.0100.01017.00
8.3.210.0060.01218.55
8.3.200.0040.00517.13
8.3.190.0110.00417.46
8.3.180.0060.00418.65
8.3.170.0030.00517.53
8.3.160.0080.00616.92
8.3.150.0120.00619.34
8.3.140.0120.00617.59
8.3.130.0160.00318.80
8.3.120.0090.00619.23
8.3.110.0000.00820.94
8.3.100.0050.00524.06
8.3.90.0120.00326.77
8.3.80.0040.00818.93
8.3.70.0080.00818.45
8.3.60.0120.01218.93
8.3.50.0150.00616.70
8.3.40.0240.00319.59
8.3.30.0130.00919.11
8.3.20.0090.00524.05
8.3.10.0090.00423.40
8.3.00.0130.00522.78
8.2.290.0120.00321.08
8.2.280.0060.00223.13
8.2.270.0150.00317.60
8.2.260.0030.00618.78
8.2.250.0030.00618.53
8.2.240.0060.00317.50
8.2.230.0050.00322.58
8.2.220.0100.00037.54
8.2.210.0060.00326.77
8.2.200.0100.00017.13
8.2.190.0110.00417.13
8.2.180.0110.00425.92
8.2.170.0180.01419.18
8.2.160.0180.01121.68
8.2.150.0150.00322.43
8.2.140.0100.00423.64
8.2.130.0090.00524.39
8.2.120.0100.00523.69
8.2.110.0080.00620.59
8.2.100.0120.00419.79
8.2.90.0160.00618.60
8.2.80.0110.00520.49
8.2.70.0120.00519.43
8.2.60.0130.00718.71
8.2.50.0130.00718.68
8.2.40.0150.00418.84
8.2.30.0090.00818.70
8.2.20.0180.00318.80
8.2.10.0140.00519.40
8.2.00.0140.00619.50
8.1.330.0100.01016.61
8.1.320.0080.00716.61
8.1.310.0040.01420.60
8.1.300.0120.00418.78
8.1.290.0040.00430.84
8.1.280.0130.01025.92
8.1.270.0020.01024.42
8.1.260.0100.00225.31
8.1.250.0060.00526.22
8.1.240.0130.00321.51
8.1.230.0170.00520.00
8.1.220.0120.00718.64
8.1.210.0110.00418.95
8.1.200.0060.00918.30
8.1.190.0160.00018.37
8.1.180.0090.00718.44
8.1.170.0080.00819.06
8.1.160.0100.00519.03
8.1.150.0120.00719.14
8.1.140.0120.01019.05
8.1.130.0150.00218.29
8.1.120.0080.00518.20
8.1.110.0080.00518.20
8.1.100.0090.00418.60
8.1.90.0120.00418.21
8.1.80.0130.00318.59
8.1.70.0110.00618.21
8.1.60.0120.00718.37
8.1.50.0160.00218.21
8.1.40.0090.00718.32
8.1.30.0090.00418.50
8.1.20.0100.00518.76
8.1.10.0070.00718.31
8.1.00.0040.00718.81
8.0.300.0090.00319.33
8.0.290.0110.00517.66
8.0.280.0110.00718.44
8.0.270.0110.00318.34
8.0.260.0090.00617.56
8.0.250.0060.00817.65
8.0.240.0100.00417.66
8.0.230.0060.00717.66
8.0.220.0090.00617.60
8.0.210.0070.00817.61
8.0.200.0070.00817.59
8.0.190.0070.00917.64
8.0.180.0060.00917.56
8.0.170.0120.00317.71
8.0.160.0130.00417.57
8.0.150.0070.00817.55
8.0.140.0100.00517.56
8.0.130.0060.00716.40
8.0.120.0120.00417.60
8.0.110.0100.00717.58
8.0.100.0070.00717.57
8.0.90.0060.00617.46
8.0.80.0060.00717.47
8.0.70.0040.00518.04
8.0.60.0080.00417.43
8.0.50.0090.00617.46
8.0.30.0060.00517.56
8.0.20.0100.00317.55
8.0.10.0040.00917.55
8.0.00.0050.00718.13
7.4.330.0070.00516.78
7.4.320.0100.00617.24
7.4.300.0180.00217.21
7.4.290.0110.00917.22
7.4.280.0150.00217.29
7.4.270.0150.00717.15
7.4.260.0140.00716.18
7.4.250.0170.00517.29
7.4.240.0190.00417.32
7.4.230.0120.00617.34
7.4.220.0120.00317.09
7.4.210.0100.00517.13
7.4.200.0100.00617.18
7.4.190.0090.00717.32
7.4.180.0090.00617.27
7.4.160.0130.00417.04
7.4.150.0100.00517.20
7.4.140.0070.00817.05
7.4.130.0120.00217.02
7.4.120.0100.00417.05
7.4.110.0090.00516.95
7.4.100.0090.00417.02
7.4.90.0100.00417.19
7.4.80.0100.00417.00
7.4.70.0080.00617.09
7.4.60.0100.00417.23
7.4.50.0100.00416.87
7.4.40.0090.00517.00
7.4.30.0060.00717.08
7.4.20.0050.00917.10
7.4.10.0090.00416.95
7.4.00.0090.00517.09
7.3.330.0140.00317.11
7.3.320.0090.00616.06
7.3.310.0120.00417.08
7.3.300.0130.00317.26
7.3.290.0110.00316.96
7.3.280.0110.00316.95
7.3.270.0110.00316.81
7.3.260.0100.00416.94
7.3.250.0090.00516.92
7.3.240.0100.00417.01
7.3.230.0090.00516.94
7.3.220.0070.00716.96
7.3.210.0080.00716.84
7.3.200.0150.00316.92
7.3.190.0110.00516.90
7.3.180.0100.00716.77
7.3.170.0130.00216.98
7.3.160.0080.00716.86
7.3.150.0080.00916.90
7.3.140.0110.00516.91
7.3.130.0090.00616.88
7.3.120.0120.00316.84
7.3.110.0120.00417.04
7.3.100.0100.00616.79
7.3.90.0120.00417.10
7.3.80.0120.00516.93
7.3.70.0090.00617.16
7.3.60.0140.00216.93
7.3.50.0110.00517.01
7.3.40.0130.00316.95
7.3.30.0090.00517.02
7.3.20.0130.00218.67
7.3.10.0130.00418.60
7.3.00.0120.00518.62

preferences:
29.09 ms | 403 KiB | 5 Q