3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<img scr1="xxxx.jpg" src="aaaa.jpg" other_attributes="some_values" />'; $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); $images = $xpath->query("//img"); foreach ($images as $image) { if ($image->hasAttribute('scr1')) { $src1 = $image->getAttribute('scr1'); $image->removeAttribute('scr1'); $image->setAttribute('src', $src1); } } echo $dom->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.5.10.0110.00817.06
8.5.00.0110.01320.28
8.4.150.0030.00014.05
8.4.140.0110.01017.77
8.4.130.0090.00218.37
8.4.120.0040.00520.92
8.4.110.0110.00822.83
8.4.100.0140.00718.09
8.4.90.0110.00919.01
8.4.80.0060.00518.05
8.4.70.0050.00418.24
8.4.60.0100.01018.91
8.4.50.0050.00418.12
8.4.40.0120.00617.81
8.4.30.0120.00817.95
8.4.20.0130.01019.69
8.4.10.0060.00318.12
8.3.280.0130.00918.53
8.3.270.0090.01116.87
8.3.260.0040.00617.20
8.3.250.0060.00219.61
8.3.240.0070.00416.80
8.3.230.0090.00817.05
8.3.220.0100.00917.54
8.3.210.0040.00417.27
8.3.200.0110.00817.11
8.3.190.0070.00217.75
8.3.180.0110.00516.52
8.3.170.0100.01017.71
8.3.160.0140.00416.93
8.3.150.0000.01517.51
8.3.140.0060.00319.29
8.3.130.0000.01017.11
8.3.120.0040.01119.25
8.3.110.0030.00720.94
8.3.100.0090.00624.06
8.3.90.0030.00726.77
8.3.80.0040.00716.99
8.3.70.0120.00316.75
8.3.60.0090.00917.13
8.3.50.0070.00716.90
8.3.40.0090.00919.06
8.3.30.0090.00618.91
8.3.20.0070.00022.28
8.3.10.0050.00324.04
8.3.00.0000.00919.91
8.2.290.0090.00620.75
8.2.280.0150.00618.88
8.2.270.0120.00617.86
8.2.260.0130.00317.61
8.2.250.0050.00317.11
8.2.240.0080.00819.23
8.2.230.0030.00622.58
8.2.220.0030.00537.54
8.2.210.0070.00026.77
8.2.200.0110.00017.00
8.2.190.0090.01217.25
8.2.180.0110.01118.79
8.2.170.0070.01119.16
8.2.160.0120.00322.96
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0030.00720.85
8.2.120.0000.00726.35
8.2.110.0050.00519.54
8.2.100.0080.00418.47
8.2.90.0040.00419.54
8.2.80.0000.00817.97
8.2.70.0050.00317.88
8.2.60.0080.00018.43
8.2.50.0040.00418.07
8.2.40.0050.00318.60
8.2.30.0030.00618.49
8.2.20.0050.00318.33
8.2.10.0000.00818.15
8.2.00.0040.00418.66
8.1.330.0130.00520.79
8.1.320.0100.00816.57
8.1.310.0070.01416.90
8.1.300.0090.00920.21
8.1.290.0060.00630.84
8.1.280.0090.00925.92
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0070.00319.66
8.1.230.0040.00720.81
8.1.220.0020.00518.29
8.1.210.0000.00818.77
8.1.200.0030.00617.85
8.1.190.0040.00417.72
8.1.180.0000.00818.10
8.1.170.0040.00418.96
8.1.160.0040.00419.29
8.1.150.0040.00420.74
8.1.140.0000.00718.05
8.1.130.0100.00019.45
8.1.120.0040.00417.90
8.1.110.0000.00717.85
8.1.100.0000.00717.85
8.1.90.0000.00817.82
8.1.80.0040.00417.93
8.1.70.0040.00417.77
8.1.60.0030.00617.93
8.1.50.0030.00717.82
8.1.40.0030.00617.99
8.1.30.0050.00318.09
8.1.20.0000.00818.11
8.1.10.0030.00517.90
8.1.00.0040.00417.93
8.0.300.0070.00019.59
8.0.290.0000.00817.13
8.0.280.0030.00318.74
8.0.270.0040.00417.65
8.0.260.0040.00417.12
8.0.250.0000.00717.34
8.0.240.0040.00417.24
8.0.230.0000.00717.35
8.0.220.0040.00417.18
8.0.210.0080.00017.25
8.0.200.0050.00517.35
8.0.190.0030.00517.40
8.0.180.0050.00217.30
8.0.170.0040.00417.22
8.0.160.0000.00817.32
8.0.150.0030.00517.27
8.0.140.0030.00417.13
8.0.130.0060.00013.68
8.0.120.0030.00517.18
8.0.110.0040.00417.22
8.0.100.0000.00717.33
8.0.90.0000.00817.36
8.0.80.0070.00717.19
8.0.70.0070.00017.04
8.0.60.0040.00417.25
8.0.50.0050.00317.37
8.0.30.0070.01117.43
8.0.20.0090.01017.54
8.0.10.0000.00717.47
8.0.00.0090.01017.09
7.4.330.0000.00515.55
7.4.320.0000.00716.95
7.4.300.0060.00016.84
7.4.290.0000.00817.03
7.4.280.0040.00416.92
7.4.270.0030.00316.88
7.4.260.0070.00016.85
7.4.250.0000.00717.00
7.4.240.0070.00016.95
7.4.230.0000.00716.68
7.4.220.0040.00416.80
7.4.210.0050.01116.93
7.4.200.0040.00416.89
7.4.160.0120.00616.94
7.4.140.0100.01017.86
7.4.130.0090.00916.96
7.4.120.0090.01116.82
7.4.110.0130.00317.02
7.4.100.0030.02016.70
7.4.90.0090.00916.92
7.4.80.0130.01019.39
7.4.70.0120.01216.91
7.4.60.0030.01216.96
7.4.50.0060.01216.84
7.4.40.0130.00416.96
7.4.00.0090.00615.33
7.3.330.0020.00213.49
7.3.320.0000.00613.52
7.3.310.0030.00316.53
7.3.300.0070.00016.61
7.3.290.0060.00916.61
7.3.280.0090.00816.66
7.3.260.0090.00916.73
7.3.240.0110.00616.93
7.3.230.0160.00316.71
7.3.210.0170.00616.89
7.3.200.0060.01016.68
7.3.190.0030.01216.82
7.3.180.0140.00716.60
7.3.170.0090.00616.72
7.3.160.0170.00016.69
7.3.10.0090.00316.55
7.3.00.0130.00316.39
7.2.330.0110.00717.02
7.2.320.0130.00917.02
7.2.310.0140.00317.08
7.2.300.0070.01116.85
7.2.290.0060.01217.07
7.2.130.0070.00717.23
7.2.120.0100.01016.93
7.2.110.0090.00617.16
7.2.100.0100.01017.08
7.2.90.0160.00317.20
7.2.80.0100.00716.87
7.2.70.0060.00916.84
7.2.60.0090.00717.06
7.2.50.0070.01016.83
7.2.40.0080.00417.06
7.2.30.0170.00717.63
7.2.20.0110.01217.68
7.2.10.0150.01117.31
7.2.00.0130.01217.65
7.1.250.0040.00715.89
7.1.200.0230.00315.65
7.1.150.0190.01317.10
7.1.140.0240.01417.25
7.1.130.0210.00816.88
7.1.120.0140.01216.83
7.1.110.0210.00916.38
7.1.100.0160.00916.22
7.1.90.0140.01115.96
7.1.80.0190.01416.14
7.1.70.0160.00915.61
7.1.60.0320.01333.49
7.1.50.0370.01932.80
7.1.40.0350.02032.77
7.1.30.0420.01532.90
7.1.20.0390.02032.95
7.1.10.0460.01114.91
7.1.00.0170.01215.04

preferences:
37.46 ms | 403 KiB | 5 Q