3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div> <img src="image/abc.png" alt="test" width="50" height="50"> <img src="http://example.com/image/abc.png" alt="test" width="50" height="50"> <img src="/image/abc.png" alt="test" width="50" height="50"> <iframe src="image/abc.png" alt="test" width="50" height="50"></iframe> </div> HTML; $base = "http://example.com/"; $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); foreach ($xpath->query("//img[not(starts-with(@src, '$base'))]") as $node) { $node->setAttribute('src', $base . ltrim($node->getAttribute('src'), '/')); } 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.00816.92
8.5.00.0080.01620.29
8.4.150.0020.00114.05
8.4.140.0130.01018.09
8.4.130.0060.01218.02
8.4.120.0120.00820.94
8.4.110.0120.00922.67
8.4.100.0100.01118.14
8.4.90.0040.00621.05
8.4.80.0080.00118.30
8.4.70.0120.00718.19
8.4.60.0080.00318.93
8.4.50.0060.00218.38
8.4.40.0080.00018.13
8.4.30.0100.01022.52
8.4.20.0200.00018.05
8.4.10.0090.00020.09
8.3.280.0110.01018.65
8.3.270.0120.00917.11
8.3.260.0130.00317.02
8.3.250.0130.00819.30
8.3.240.0050.00417.53
8.3.230.0110.00817.02
8.3.220.0130.00619.37
8.3.210.0100.00916.89
8.3.200.0070.00216.96
8.3.190.0130.00719.09
8.3.180.0070.00818.64
8.3.170.0110.00719.14
8.3.160.0120.00317.13
8.3.150.0090.00917.38
8.3.140.0110.00417.16
8.3.130.0060.00318.59
8.3.120.0030.00620.81
8.3.110.0150.00620.94
8.3.100.0160.00324.06
8.3.90.0000.00826.77
8.3.80.0060.00319.36
8.3.70.0090.00618.68
8.3.60.0110.01118.55
8.3.50.0070.01023.75
8.3.40.0090.00619.05
8.3.30.0110.00418.95
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0050.00326.16
8.2.290.0090.01020.81
8.2.280.0100.00620.86
8.2.270.0110.00717.61
8.2.260.0050.00519.00
8.2.250.0030.00618.84
8.2.240.0030.00717.68
8.2.230.0160.00322.58
8.2.220.0030.00637.54
8.2.210.0040.00426.77
8.2.200.0090.00018.88
8.2.190.0120.00316.83
8.2.180.0140.00425.92
8.2.170.0060.00919.08
8.2.160.0120.00322.96
8.2.150.0080.00025.66
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0090.00020.10
8.2.110.0040.00420.65
8.2.100.0120.00918.03
8.2.90.0000.00818.25
8.2.80.0030.00619.03
8.2.70.0030.00518.00
8.2.60.0040.00417.88
8.2.50.0040.00817.88
8.2.40.0030.00519.85
8.2.30.0000.00719.50
8.2.20.0050.00518.34
8.2.10.0040.00419.59
8.2.00.0000.00719.74
8.1.330.0110.00822.45
8.1.320.0130.00616.51
8.1.310.0080.00016.98
8.1.300.0060.00316.32
8.1.290.0090.00030.84
8.1.280.0030.01225.92
8.1.270.0120.00322.52
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0190.00324.40
8.1.230.0080.00321.22
8.1.220.0060.00318.84
8.1.210.0040.00418.77
8.1.200.0040.00417.85
8.1.190.0000.00817.60
8.1.180.0050.00518.10
8.1.170.0000.00817.85
8.1.160.0060.00319.46
8.1.150.0000.00719.23
8.1.140.0000.00719.26
8.1.130.0030.00520.51
8.1.120.0050.00217.79
8.1.110.0030.00517.90
8.1.100.0000.00817.72
8.1.90.0070.00017.73
8.1.80.0000.00817.87
8.1.70.0030.00317.88
8.1.60.0060.00317.89
8.1.50.0090.00017.83
8.1.40.0040.00417.84
8.1.30.0030.00518.02
8.1.20.0040.00417.98
8.1.10.0000.00917.90
8.1.00.0030.00517.80
8.0.300.0030.00618.99
8.0.290.0040.00417.25
8.0.280.0000.00718.82
8.0.270.0060.00317.26
8.0.260.0030.00318.94
8.0.250.0000.00817.33
8.0.240.0040.00417.41
8.0.230.0030.00517.44
8.0.220.0050.00317.27
8.0.210.0040.00417.36
8.0.200.0060.00017.41
8.0.190.0030.00617.34
8.0.180.0070.00017.29
8.0.170.0000.00917.25
8.0.160.0030.00517.27
8.0.150.0000.00817.23
8.0.140.0070.00317.21
8.0.130.0030.00313.76
8.0.120.0030.00517.19
8.0.110.0030.00517.22
8.0.100.0040.00417.25
8.0.90.0070.00017.35
8.0.80.0080.00717.33
8.0.70.0030.00517.17
8.0.60.0040.00417.30
8.0.50.0040.00417.46
8.0.30.0130.00317.41
8.0.20.0060.01517.60
8.0.10.0000.00817.42
8.0.00.0170.02217.53
7.4.330.0000.00515.55
7.4.320.0030.00316.94
7.4.300.0030.00316.98
7.4.290.0000.00816.86
7.4.280.0000.00816.91
7.4.270.0030.00316.97
7.4.260.0030.00313.67
7.4.250.0040.00416.95
7.4.240.0070.00016.92
7.4.230.0060.00317.00
7.4.220.0040.00316.82
7.4.210.0080.00716.92
7.4.200.0000.00717.12
7.4.130.0100.01016.87
7.4.120.0100.01016.96
7.4.110.0120.00616.66
7.4.100.0100.01316.93
7.4.90.0030.01516.92
7.4.80.0030.01516.77
7.4.70.0080.00817.03
7.4.60.0060.01216.73
7.4.50.0150.00317.09
7.4.40.0130.00616.77
7.4.30.0070.01016.77
7.4.20.0140.00716.75
7.4.10.0130.01116.74
7.4.00.0110.00816.96
7.3.330.0000.00716.71
7.3.320.0050.00013.64
7.3.310.0030.00316.56
7.3.300.0030.00316.79
7.3.290.0030.01116.76
7.3.260.0070.01316.79
7.3.250.0130.00816.70
7.3.240.0100.01016.71
7.3.230.0090.00917.03
7.3.220.0070.01016.75
7.3.210.0040.01316.79
7.3.200.0090.00916.73
7.3.190.0100.00616.78
7.3.180.0080.01316.99
7.3.170.0150.00316.97
7.3.160.0070.01016.81
7.3.150.0180.00016.93
7.3.140.0170.00016.72
7.3.130.0110.00616.92
7.3.120.0120.00616.88
7.3.110.0070.01116.74
7.3.100.0140.00316.92
7.3.90.0040.01416.72
7.3.80.0060.01916.67
7.3.70.0170.00716.91
7.3.60.0130.01216.91
7.3.50.0130.01216.80
7.3.40.0120.01216.89
7.3.30.0100.01016.76
7.3.20.0160.01016.71
7.3.10.0100.00716.72
7.3.00.0190.00316.72

preferences:
33.39 ms | 403 KiB | 5 Q