3v4l.org

run code in 300+ PHP versions simultaneously
<?php function remove_script_tags($html){ $dom = new DOMDocument(); $dom->loadHTML($html); $script = $dom->getElementsByTagName('script'); $remove = []; foreach($script as $item){ $remove[] = $item; } foreach ($remove as $item){ $item->parentNode->removeChild($item); } $html = $dom->saveHTML(); return $html; } $s = []; $s[] = "hey buddy what's up script"; $s[] = "Hi Friend <script>alert('hello world');</script>"; $s[] = "<script src=\"http://jquery.com\">joyjoy</script>happy"; foreach($s as $t){ echo $t.' ==> '.remove_script_tags($t)."\n"; }

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.90.0030.00518.63
8.3.80.0030.00618.68
8.3.70.0090.01218.43
8.3.60.0110.01118.56
8.3.50.0190.00323.74
8.3.40.0080.00818.91
8.3.30.0110.00419.03
8.3.20.0040.00421.14
8.3.10.0040.00422.27
8.3.00.0070.00021.94
8.2.210.0130.00726.77
8.2.200.0060.00316.88
8.2.190.0090.00617.09
8.2.180.0120.00618.79
8.2.170.0090.00622.96
8.2.160.0070.00720.51
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00426.16
8.2.110.0050.00521.16
8.2.100.0080.00318.16
8.2.90.0030.00618.47
8.2.80.0070.00020.84
8.2.70.0000.01017.88
8.2.60.0040.00417.88
8.2.50.0000.00817.63
8.2.40.0000.00819.47
8.2.30.0060.00319.47
8.2.20.0040.00418.28
8.2.10.0040.00419.51
8.2.00.0080.00019.52
8.1.290.0040.00430.84
8.1.280.0190.00325.92
8.1.270.0060.00324.01
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0090.00022.45
8.1.230.0030.00721.18
8.1.220.0050.00317.89
8.1.210.0000.00819.02
8.1.200.0030.00617.48
8.1.190.0060.00617.47
8.1.180.0040.00418.10
8.1.170.0020.00519.28
8.1.160.0040.00419.16
8.1.150.0040.00419.33
8.1.140.0000.00820.96
8.1.130.0050.00320.54
8.1.120.0070.00017.67
8.1.110.0040.00417.62
8.1.100.0050.00517.70
8.1.90.0080.00017.55
8.1.80.0080.00017.57
8.1.70.0030.00317.69
8.1.60.0100.00017.86
8.1.50.0040.00417.69
8.1.40.0030.00617.73
8.1.30.0000.00817.80
8.1.20.0040.00417.82
8.1.10.0000.00817.79
8.1.00.0040.00417.66
8.0.300.0020.00520.36
8.0.290.0080.00017.00
8.0.280.0050.00218.56
8.0.270.0050.00217.03
8.0.260.0070.00020.34
8.0.250.0080.00017.18
8.0.240.0050.00317.17
8.0.230.0030.00417.20
8.0.220.0030.00517.06
8.0.210.0080.00017.04
8.0.200.0030.00317.18
8.0.190.0000.00717.18
8.0.180.0000.00717.07
8.0.170.0060.00317.14
8.0.160.0030.00317.06
8.0.150.0040.00417.18
8.0.140.0030.00617.00
8.0.130.0000.00513.53
8.0.120.0050.00217.07
8.0.110.0000.00717.20
8.0.100.0000.00817.13
8.0.90.0000.00917.20
8.0.80.0080.00817.00
8.0.70.0050.00317.14
8.0.60.0000.00717.11
8.0.50.0040.00416.82
8.0.30.0030.01317.52
8.0.20.0120.01117.44
8.0.10.0000.00717.33
8.0.00.0100.00717.02
7.4.330.0000.00516.94
7.4.320.0030.00316.80
7.4.300.0070.00016.72
7.4.290.0040.00416.81
7.4.280.0060.00316.79
7.4.270.0030.00316.78
7.4.260.0030.00313.54
7.4.250.0000.00716.75
7.4.240.0050.00216.76
7.4.230.0000.00716.80
7.4.220.0040.00316.57
7.4.210.0070.00916.73
7.4.200.0040.00416.73
7.4.130.0150.00816.91
7.4.120.0130.00316.65
7.4.110.0070.01016.73
7.4.100.0190.00316.72
7.4.90.0100.00716.76
7.4.80.0130.00319.39
7.4.70.0100.00616.64
7.4.60.0070.01016.94
7.4.50.0040.01216.22
7.4.40.0100.00716.68
7.4.10.0070.00714.90
7.4.00.0090.00914.96
7.3.330.0000.00716.50
7.3.320.0000.00613.38
7.3.310.0070.00016.47
7.3.300.0030.00616.32
7.3.290.0060.01216.50
7.3.280.0070.01316.49
7.3.260.0150.00316.76
7.3.240.0080.00916.86
7.3.230.0200.00316.68
7.3.210.0100.00716.80
7.3.200.0030.01316.93
7.3.190.0000.01616.73
7.3.180.0080.01416.58
7.3.170.0130.01016.58
7.3.160.0130.00316.79
7.3.130.0070.01314.72
7.3.120.0040.01214.95
7.3.110.0090.00614.73
7.3.100.0110.00914.93
7.3.90.0040.01614.70
7.3.80.0110.00414.81
7.3.70.0050.01015.01
7.3.60.0030.01114.80
7.3.50.0130.00315.05
7.3.40.0030.01114.71
7.3.30.0110.00414.82
7.3.20.0100.00714.84
7.3.10.0030.01714.84
7.3.00.0040.01514.98
7.2.330.0150.00416.80
7.2.320.0130.01017.06
7.2.310.0090.00916.80
7.2.300.0110.00717.05
7.2.290.0060.01117.07
7.2.260.0090.01215.20
7.2.250.0040.01215.30
7.2.240.0090.00615.36
7.2.230.0100.01015.42
7.2.220.0090.01215.12
7.2.210.0110.00315.08
7.2.200.0100.00515.10
7.2.190.0080.00815.23
7.2.180.0020.01214.85
7.2.170.0110.00415.03
7.2.160.0040.01615.23
7.2.150.0090.00615.30
7.2.140.0160.00315.04
7.2.130.0060.00915.25
7.2.120.0070.00715.21
7.2.110.0040.01115.15
7.2.100.0100.00715.00
7.2.90.0080.00815.37
7.2.80.0030.01315.12
7.2.70.0030.01315.25
7.2.60.0070.01015.33
7.2.50.0140.00615.08
7.2.40.0120.00315.09
7.2.30.0090.00615.34
7.2.20.0100.00515.23
7.2.10.0070.00714.91
7.2.00.0130.00315.28

preferences:
66.05 ms | 401 KiB | 5 Q