3v4l.org

run code in 300+ PHP versions simultaneously
<?php function scrubAttributes($html, $attributes = []) { $dom = new DOMDocument(); $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); for ($els = $dom->getElementsByTagname('*'), $i = $els->length - 1; $i >= 0; $i--) { for ($attrs = $els->item($i)->attributes, $ii = $attrs->length - 1; $ii >= 0; $ii--) { $els->item($i)->removeAttribute($attrs->item($ii)->name); } } return $dom->saveHTML(); } $html = '<p style="padding:0px;"> <strong style="padding:0;margin:0;">hello</strong> </p>'; echo scrubAttributes($html);

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.5.10.0110.00816.87
8.5.00.0100.01220.14
8.4.150.0020.00014.05
8.4.140.0130.00818.04
8.4.130.0070.00618.89
8.4.120.0110.00924.38
8.4.110.0120.00818.90
8.4.100.0130.00817.84
8.4.90.0070.00218.28
8.4.80.0110.00818.11
8.4.70.0070.00217.95
8.4.60.0100.01018.85
8.4.50.0090.00417.91
8.4.40.0060.01319.28
8.4.30.0100.01020.57
8.4.20.0210.00017.77
8.4.10.0100.00720.71
8.3.280.0130.00818.56
8.3.270.0070.01217.10
8.3.260.0060.00316.64
8.3.250.0070.00418.84
8.3.240.0100.00817.28
8.3.230.0100.01016.62
8.3.220.0110.00717.35
8.3.210.0100.00416.68
8.3.200.0060.00216.76
8.3.190.0100.00416.66
8.3.180.0100.00816.91
8.3.170.0110.00721.13
8.3.160.0120.00620.53
8.3.150.0120.00617.26
8.3.140.0130.00319.16
8.3.130.0030.00518.52
8.3.120.0090.00618.98
8.3.110.0060.00920.94
8.3.100.0040.00716.97
8.3.90.0080.00026.77
8.3.80.0060.00316.88
8.3.70.0040.01216.98
8.3.60.0090.00618.80
8.3.50.0100.01123.76
8.3.40.0040.01119.00
8.3.30.0000.01418.84
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.290.0110.00821.05
8.2.280.0080.01218.45
8.2.270.0100.01019.16
8.2.260.0000.00819.23
8.2.250.0050.00517.13
8.2.240.0000.00917.20
8.2.230.0000.00922.58
8.2.220.0030.01324.06
8.2.210.0040.00426.77
8.2.200.0090.00018.91
8.2.190.0140.00716.88
8.2.180.0140.00025.92
8.2.170.0120.00418.91
8.2.160.0110.00322.96
8.2.150.0080.00025.66
8.2.140.0100.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.78
8.2.110.0100.00022.32
8.2.100.0110.00018.03
8.2.90.0000.00820.03
8.2.80.0000.00818.91
8.2.70.0030.00517.75
8.2.60.0000.01018.16
8.2.50.0000.00818.16
8.2.40.0030.00618.47
8.2.30.0070.00018.21
8.2.20.0050.00318.12
8.2.10.0000.00719.45
8.2.00.0080.00019.60
8.1.330.0130.00718.36
8.1.320.0130.00616.34
8.1.310.0150.00318.76
8.1.300.0060.01318.01
8.1.290.0060.00330.84
8.1.280.0150.00625.92
8.1.270.0080.00024.66
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0060.00324.21
8.1.230.0070.00319.47
8.1.220.0000.00817.91
8.1.210.0030.00618.77
8.1.200.0060.00317.60
8.1.190.0040.00417.47
8.1.180.0050.00318.10
8.1.170.0000.01118.89
8.1.160.0030.00518.97
8.1.150.0000.00719.03
8.1.140.0040.00418.97
8.1.130.0070.00020.22
8.1.120.0070.00419.04
8.1.110.0020.00517.56
8.1.100.0040.00417.68
8.1.90.0020.00617.62
8.1.80.0060.00317.57
8.1.70.0070.00417.55
8.1.60.0060.00717.79
8.1.50.0100.00417.69
8.1.40.0060.00617.68
8.1.30.0090.00517.80
8.1.20.0120.00417.80
8.1.10.0110.00417.75
8.1.00.0100.00317.72
8.0.300.0040.00418.77
8.0.290.0080.00016.88
8.0.280.0070.00018.75
8.0.270.0080.00318.13
8.0.260.0030.00318.76
8.0.250.0040.00417.17
8.0.240.0000.00717.14
8.0.230.0030.00617.07
8.0.220.0080.00317.00
8.0.210.0070.00416.97
8.0.200.0050.00717.05
8.0.190.0090.00217.09
8.0.180.0040.00816.97
8.0.170.0070.00517.02
8.0.160.0050.00617.03
8.0.150.0090.00216.92
8.0.140.0070.00516.99
8.0.130.0060.00515.19
8.0.120.0060.00616.97
8.0.110.0070.00516.99
8.0.100.0110.00116.99
8.0.90.0040.00616.89
8.0.80.0070.00816.96
8.0.70.0060.00616.96
8.0.60.0070.00316.85
8.0.50.0080.00416.95
8.0.30.0120.00416.98
8.0.20.0140.00517.05
8.0.10.0140.00717.14
8.0.00.0110.00917.17
7.4.330.0000.00615.55
7.4.320.0030.00316.73
7.4.300.0050.00616.83
7.4.290.0080.00516.84
7.4.280.0070.00616.80
7.4.270.0050.00616.80
7.4.260.0070.00515.08
7.4.250.0100.00216.70
7.4.240.0100.00316.72
7.4.230.0060.00516.68
7.4.220.0040.00716.68
7.4.210.0090.00616.74
7.4.200.0080.00216.73
7.4.190.0000.01316.73
7.4.180.0070.00516.77
7.4.160.0060.00916.80
7.4.150.0120.00616.67
7.4.140.0090.00916.49
7.4.130.0080.01116.70
7.4.120.0110.01016.61
7.4.110.0100.01016.69
7.4.100.0110.00816.73
7.4.90.0100.01016.60
7.4.80.0140.00516.71
7.4.70.0110.01016.65
7.4.60.0150.00816.67
7.4.50.0130.00916.65
7.4.40.0130.00616.70
7.4.30.0120.01116.63
7.4.20.0110.00816.61
7.4.10.0120.00716.59
7.4.00.0100.00816.65
7.3.330.0080.00516.49
7.3.320.0030.00814.96
7.3.310.0070.00316.47
7.3.300.0020.00916.52
7.3.290.0080.00716.47
7.3.280.0140.00016.45
7.3.270.0110.00916.40
7.3.260.0080.01116.47
7.3.250.0120.00716.53
7.3.240.0110.00916.60
7.3.230.0130.00716.49
7.3.220.0110.00916.47
7.3.210.0130.00716.59
7.3.200.0150.00716.58
7.3.190.0120.00816.50
7.3.180.0110.01016.59
7.3.170.0100.01016.55
7.3.160.0090.01016.54
7.3.150.0130.00616.56
7.3.140.0130.00716.55
7.3.130.0100.00916.53
7.3.120.0120.00916.50
7.3.110.0120.01116.44
7.3.100.0070.01016.52
7.3.90.0130.00516.66
7.3.80.0150.00516.55
7.3.70.0110.00816.63
7.3.60.0110.00816.61
7.3.50.0140.00816.69
7.3.40.0120.00716.57
7.3.30.0150.00416.59
7.3.20.0120.00817.15
7.3.10.0120.00817.11
7.3.00.0140.00717.12

preferences:
28.34 ms | 403 KiB | 5 Q