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(); $html = preg_replace('/<!DOCTYPE.*?<html>.*?<body><p>/ims', '', $html); $html = str_replace('</p></body></html>', '', $html); 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.0090.00926.77
8.3.80.0090.00019.36
8.3.70.0180.01618.09
8.3.60.0300.00917.71
8.3.50.0090.01322.24
8.3.40.0160.01019.11
8.3.30.0180.00818.71
8.3.20.0180.00620.44
8.3.10.0140.00720.65
8.3.00.0180.00319.73
8.2.210.0090.00626.77
8.2.200.0060.00318.88
8.2.190.0260.00116.99
8.2.180.0240.00816.92
8.2.170.0200.00420.25
8.2.160.0220.00220.45
8.2.150.0210.00420.91
8.2.140.0150.01021.21
8.2.130.0130.01124.12
8.2.120.0190.00721.35
8.2.110.0160.00919.41
8.2.100.0180.00818.62
8.2.90.0130.00818.90
8.2.80.0170.00518.59
8.2.70.0170.00618.50
8.2.60.0140.01218.26
8.2.50.0180.00618.27
8.2.40.0170.00818.79
8.2.30.0180.00718.66
8.2.20.0160.00818.29
8.2.10.0130.00918.57
8.2.00.0150.00718.62
8.1.290.0070.00330.84
8.1.280.0180.01421.25
8.1.270.0220.00221.57
8.1.260.0210.00922.08
8.1.250.0210.00522.70
8.1.240.0170.00719.42
8.1.230.0180.00818.22
8.1.220.0120.01118.34
8.1.210.0180.00618.56
8.1.200.0160.00818.21
8.1.190.0130.00817.72
8.1.180.0160.00818.39
8.1.170.0170.00618.47
8.1.160.0190.00518.31
8.1.150.0160.00718.22
8.1.140.0200.00518.78
8.1.130.0160.00517.94
8.1.120.0150.00918.04
8.1.110.0150.00617.88
8.1.100.0150.00818.29
8.1.90.0150.00518.00
8.1.80.0140.00618.35
8.1.70.0160.00517.95
8.1.60.0140.00818.07
8.1.50.0150.00917.94
8.1.40.0140.00818.01
8.1.30.0170.00518.13
8.1.20.0130.00918.51
8.1.10.0130.00818.21
8.1.00.0180.00518.01
8.0.300.0140.01017.96
8.0.290.0210.00617.34
8.0.280.0200.00717.60
8.0.270.0120.00917.50
8.0.260.0160.00817.59
8.0.250.0180.00617.38
8.0.240.0180.00817.31
8.0.230.0140.00917.30
8.0.220.0220.00517.28
8.0.210.0210.00617.27
8.0.200.0230.00317.29
8.0.190.0190.00717.44
8.0.180.0170.00517.32
8.0.170.0140.01117.37
8.0.160.0170.00617.29
8.0.150.0190.00617.30
8.0.140.0160.00917.24
8.0.130.0150.00916.42
8.0.120.0210.00417.21
8.0.110.0200.00617.22
8.0.100.0190.00817.31
8.0.90.0210.00617.20
8.0.80.0200.00917.27
8.0.70.0140.00717.69
8.0.60.0190.00617.25
8.0.50.0200.00617.46
8.0.30.0180.00817.33
8.0.20.0200.00717.45
8.0.10.0240.00417.39
8.0.00.0180.00817.84
7.4.330.0170.00717.02
7.4.320.0210.00417.01
7.4.300.0170.00917.04
7.4.290.0170.00617.50
7.4.280.0190.00617.10
7.4.270.0220.00517.02
7.4.260.0190.00916.25
7.4.250.0240.00317.06
7.4.240.0210.00517.05
7.4.230.0190.00617.07
7.4.220.0160.00517.08
7.4.210.0150.00817.15
7.4.200.0160.00617.17
7.4.190.0230.00717.16
7.4.180.0190.01117.14
7.4.160.0250.00717.06
7.4.150.0210.00917.09
7.4.140.0270.00417.49
7.4.130.0210.00916.95
7.4.120.0190.00916.99
7.4.110.0190.00817.07
7.4.100.0230.00617.13
7.4.90.0230.00717.41
7.4.80.0180.01217.62
7.4.70.0200.00917.09
7.4.60.0220.00716.99
7.4.50.0210.00917.38
7.4.40.0200.00717.07
7.4.30.0260.00717.06
7.4.20.0250.00816.97
7.4.10.0220.00616.59
7.4.00.0230.01016.42
7.3.330.0210.00816.86
7.3.320.0200.00416.05
7.3.310.0170.00817.21
7.3.300.0170.00617.01
7.3.290.0200.00516.83
7.3.280.0170.01016.83
7.3.270.0250.00616.87
7.3.260.0180.01017.25
7.3.250.0260.00317.42
7.3.240.0160.00716.90
7.3.230.0220.00816.82
7.3.220.0240.01016.97
7.3.210.0220.00816.95
7.3.200.0200.00816.88
7.3.190.0200.00816.94
7.3.180.0220.00816.96
7.3.170.0220.00817.06
7.3.160.0210.00716.90
7.3.150.0270.00517.34
7.3.140.0260.00717.44
7.3.130.0240.00616.43
7.3.120.0190.00916.44
7.3.110.0190.00616.87
7.3.100.0230.00316.52
7.3.90.0220.00416.92
7.3.80.0170.00916.88
7.3.70.0160.00717.07
7.3.60.0210.00616.50
7.3.50.0190.00816.50
7.3.40.0190.00616.52
7.3.30.0180.00816.57
7.3.20.0260.00717.41
7.3.10.0200.00817.28
7.3.00.0230.00617.32
7.2.340.0230.00717.06
7.2.330.0240.00416.97
7.2.320.0170.01117.11
7.2.310.0250.00517.04
7.2.300.0210.00717.05
7.2.290.0190.00816.95
7.2.280.0240.00717.03
7.2.270.0230.00516.99
7.2.260.0190.00816.56
7.2.250.0200.00717.05
7.2.240.0160.00916.57
7.2.230.0140.01116.57
7.2.220.0190.00816.56
7.2.210.0190.00816.54
7.2.200.0200.00816.62
7.2.190.0250.00216.66
7.2.180.0170.00816.70
7.2.170.0210.00516.69
7.2.160.0180.01016.62
7.2.150.0210.00817.49
7.2.140.0190.01017.61
7.2.130.0220.00717.67
7.2.120.0240.00417.55
7.2.110.0190.00917.64
7.2.100.0190.00717.68
7.2.90.0210.00617.60
7.2.80.0230.00417.60
7.2.70.0210.00817.66
7.2.60.0190.00717.56
7.2.50.0360.00917.45
7.2.40.0210.00717.56
7.2.30.0240.00517.68
7.2.20.0210.00717.63
7.2.10.0210.00617.72
7.2.00.0150.00917.66

preferences:
27.84 ms | 401 KiB | 5 Q