3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <html> <body> <div>foo</div> <script>console.log('bar');</script> <script>var foo = 5;</script> <script>console.log('leave me alone');</script> </body> </html> HTML; $doc = new \DOMDocument(); $doc->loadHTML($html, LIBXML_HTML_NODEFDTD); $xpath = new \DOMXPath($doc); foreach ($xpath->query('//script[contains(text(), \'foo\') or contains(text(), \'bar\')]') as $script_tag) { $script_tag->parentNode->removeChild($script_tag); } echo $doc->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.3.70.0040.01116.73
8.3.60.0140.00718.80
8.3.50.0140.00018.25
8.3.40.0070.01018.99
8.3.30.0090.00618.91
8.3.20.0040.00420.91
8.3.10.0030.00620.78
8.3.00.0040.00421.39
8.2.190.0070.00718.75
8.2.180.0150.01116.72
8.2.170.0070.01122.96
8.2.160.0150.00019.27
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0070.00421.43
8.2.110.0030.00719.69
8.2.100.0000.01318.24
8.2.90.0000.00818.59
8.2.80.0040.00418.30
8.2.70.0000.00918.18
8.2.60.0000.00818.23
8.2.50.0000.00818.10
8.2.40.0060.00319.64
8.2.30.0040.00419.65
8.2.20.0050.00318.41
8.2.10.0020.00519.83
8.2.00.0000.00718.47
8.1.280.0060.01025.92
8.1.270.0110.00019.15
8.1.260.0050.00526.35
8.1.250.0000.00728.09
8.1.240.0120.00622.57
8.1.230.0060.00621.28
8.1.220.0050.00318.13
8.1.210.0060.00319.33
8.1.200.0030.00617.61
8.1.190.0050.00317.60
8.1.180.0030.00518.10
8.1.170.0000.00818.88
8.1.160.0050.00319.27
8.1.150.0080.00319.13
8.1.140.0050.00320.58
8.1.130.0000.00720.55
8.1.120.0040.00417.79
8.1.110.0060.00317.71
8.1.100.0030.00517.72
8.1.90.0040.00417.74
8.1.80.0000.00717.81
8.1.70.0000.00717.69
8.1.60.0030.00517.86
8.1.50.0060.00317.90
8.1.40.0040.00417.75
8.1.30.0000.00817.92
8.1.20.0030.00917.92
8.1.10.0080.00017.86
8.1.00.0040.00417.88
8.0.300.0070.00020.20
8.0.290.0090.00017.13
8.0.280.0050.00318.76
8.0.270.0050.00517.51
8.0.260.0090.00018.72
8.0.250.0070.00017.22
8.0.240.0000.00817.33
8.0.230.0000.00717.34
8.0.220.0050.00317.33
8.0.210.0030.00317.32
8.0.200.0000.00717.39
8.0.190.0050.00217.17
8.0.180.0030.00617.18
8.0.170.0000.00917.21
8.0.160.0070.00017.23
8.0.150.0000.00717.23
8.0.140.0030.00317.25
8.0.130.0000.00613.70
8.0.120.0070.00017.16
8.0.110.0000.00717.42
8.0.100.0040.00417.34
8.0.90.0030.00417.31
8.0.80.0060.01017.38
8.0.70.0000.00717.30
8.0.60.0040.00417.38
8.0.50.0040.00417.14
8.0.30.0090.00717.44
8.0.20.0070.01117.50
8.0.10.0040.00417.27
8.0.00.0070.01017.25
7.4.330.0060.00015.55
7.4.320.0030.00316.91
7.4.300.0000.00716.88
7.4.290.0000.00716.94
7.4.280.0000.00716.81
7.4.270.0000.00716.92
7.4.260.0000.00716.89
7.4.250.0040.00416.74
7.4.240.0000.00716.82
7.4.230.0040.00416.94
7.4.220.0090.00016.64
7.4.210.0090.00816.90
7.4.200.0030.00416.68
7.4.160.0090.00816.83
7.4.140.0100.01017.86
7.4.130.0100.00716.68
7.4.120.0150.00316.70
7.4.110.0090.00916.77
7.4.100.0170.00716.98
7.4.90.0100.00716.74
7.4.80.0180.00319.39
7.4.70.0130.00616.82
7.4.60.0070.01516.59
7.4.50.0110.00716.80
7.4.40.0070.01016.54
7.4.00.0030.01115.00
7.3.330.0050.00013.45
7.3.320.0030.00313.42
7.3.310.0040.00416.70
7.3.300.0080.00016.54
7.3.290.0030.00316.69
7.3.280.0100.01316.56
7.3.260.0100.01116.73
7.3.240.0070.01116.78
7.3.230.0150.00316.80
7.3.210.0130.00316.95
7.3.200.0040.01216.71
7.3.190.0090.00916.80
7.3.180.0130.00316.87
7.3.170.0120.00916.62
7.3.160.0110.00716.69
7.3.120.0060.01214.99
7.3.110.0030.01414.96
7.3.100.0030.01315.04
7.3.90.0030.01014.93
7.3.80.0070.01014.81
7.3.70.0100.00714.92
7.3.60.0060.00614.84
7.3.50.0060.00314.96
7.3.40.0060.00615.00
7.3.30.0070.00714.91
7.3.20.0410.00615.81
7.3.10.0310.01515.97
7.3.00.0340.00815.82
7.2.330.0040.01716.90
7.2.320.0060.01416.85
7.2.310.0070.01016.97
7.2.300.0070.01017.07
7.2.290.0120.00917.12
7.2.250.0100.01015.40
7.2.240.0100.01015.00
7.2.230.0060.00915.28
7.2.220.0030.01315.28
7.2.210.0060.00615.06
7.2.200.0000.01115.25
7.2.190.0060.00915.31
7.2.180.0110.00015.44
7.2.170.0030.00615.36
7.2.160.0030.00615.23
7.2.150.0300.00516.28
7.2.140.0410.01016.14
7.2.130.0310.01016.09
7.2.120.0420.00316.14
7.2.110.0320.00515.94
7.2.100.0320.00516.11
7.2.90.0470.00516.40
7.2.80.0350.00915.87
7.2.70.0310.00616.06
7.2.60.0360.01116.07
7.2.50.0320.00716.17
7.2.40.0320.00615.90
7.2.30.0250.01216.11
7.2.20.0340.00416.02
7.2.10.0290.00715.83
7.2.00.0470.00716.17
7.1.330.0030.01415.89
7.1.320.0000.01415.89
7.1.310.0070.00316.12
7.1.300.0000.01116.18
7.1.290.0080.00615.92
7.1.280.0120.00015.82
7.1.270.0000.01516.02
7.1.260.0060.00716.00
7.1.250.0280.01114.95
7.1.240.0040.01116.09
7.1.230.0030.01016.11
7.1.220.0060.00315.98
7.1.210.0030.00915.96
7.1.200.0070.01015.88
7.1.190.0060.01215.92
7.1.180.0070.00715.98
7.1.170.0030.00715.80
7.1.160.0070.00715.98
7.1.150.0070.00415.93
7.1.140.0060.00615.87
7.1.130.0060.00316.13
7.1.120.0000.01115.92
7.1.110.0030.01015.77
7.1.100.0070.00416.05
7.1.90.0030.01015.90
7.1.80.0120.00315.88
7.1.70.0070.01015.96
7.1.60.0060.00916.00
7.1.50.0000.01115.99
7.1.40.0060.00615.81
7.1.30.0060.00315.86
7.1.20.0000.01116.07
7.1.10.0080.00316.00
7.1.00.0070.00715.69

preferences:
28.26 ms | 401 KiB | 5 Q