3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $htmlString = <<<_HTML <div> <a href="A"><img src="X"></a> <a href="C"><img src="X"></a> <a href="D"><img src="X"></a> <a href="E"><img src="X"></a> <a href="F"><img src="X"></a> <p> <a href="G"><img src="X"></a> </p> <a href="H">No image in this one</a> </div> _HTML; $doc = new DOMDocument(); $doc->loadHTML($htmlString, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($doc); $links = $xpath->query('//a[@href and img]'); foreach ($links as $link) { $link->setAttribute('href', 'B'); } $newHtmlString = $doc->saveHTML(); echo $newHtmlString;

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.60.0110.01117.13
8.3.50.0060.01220.15
8.3.40.0130.00919.16
8.3.30.0190.00318.98
8.3.20.0080.00022.11
8.3.10.0000.00723.91
8.3.00.0070.00721.94
8.2.180.0110.00418.66
8.2.170.0080.01222.96
8.2.160.0110.00421.24
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0050.00319.58
8.2.120.0090.00026.35
8.2.110.0060.00322.76
8.2.100.0110.00017.91
8.2.90.0060.00318.00
8.2.80.0040.00419.15
8.2.70.0030.00618.18
8.2.60.0100.00018.47
8.2.50.0060.00318.10
8.2.40.0040.00418.47
8.2.30.0060.00318.28
8.2.20.0020.00518.54
8.2.10.0030.00518.46
8.2.00.0020.00518.61
8.1.280.0120.00325.92
8.1.270.0000.00822.34
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0110.00024.29
8.1.230.0080.00321.21
8.1.220.0030.00518.02
8.1.210.0080.00018.77
8.1.200.0030.00717.47
8.1.190.0040.00417.48
8.1.180.0050.00319.25
8.1.170.0000.01118.77
8.1.160.0040.00419.19
8.1.150.0000.00719.23
8.1.140.0000.00819.57
8.1.130.0000.00717.75
8.1.120.0040.00417.75
8.1.110.0040.00417.80
8.1.100.0040.00417.73
8.1.90.0000.00717.69
8.1.80.0040.00417.86
8.1.70.0070.00017.77
8.1.60.0060.00617.90
8.1.50.0040.00417.91
8.1.40.0000.00817.90
8.1.30.0080.00018.02
8.1.20.0040.00418.02
8.1.10.0000.00817.84
8.1.00.0060.00517.83
8.0.300.0000.00718.77
8.0.290.0050.00517.00
8.0.280.0000.00718.82
8.0.270.0040.00417.25
8.0.260.0000.00817.24
8.0.250.0040.00417.32
8.0.240.0050.00217.29
8.0.230.0030.00317.35
8.0.220.0030.00317.21
8.0.210.0000.00717.28
8.0.200.0070.00017.29
8.0.190.0040.00417.29
8.0.180.0070.00017.34
8.0.170.0000.00917.34
8.0.160.0000.00717.34
8.0.150.0040.00417.14
8.0.140.0000.00717.28
8.0.130.0030.00313.75
8.0.120.0000.00817.27
8.0.110.0000.00817.23
8.0.100.0040.00417.38
8.0.90.0000.00717.22
8.0.80.0120.00317.21
8.0.70.0050.00317.09
8.0.60.0040.00417.28
8.0.50.0050.00317.20
8.0.30.0100.00717.33
8.0.20.0090.01217.42
8.0.10.0050.00317.39
8.0.00.0060.01217.12
7.4.330.0000.00517.05
7.4.320.0030.00316.80
7.4.300.0030.00316.83
7.4.290.0000.00716.94
7.4.280.0060.00316.91
7.4.270.0050.00216.81
7.4.260.0050.00216.81
7.4.250.0030.00616.93
7.4.240.0070.00016.71
7.4.230.0040.00416.82
7.4.220.0040.00416.70
7.4.210.0000.01516.82
7.4.200.0000.00716.96
7.4.160.0090.00816.87
7.4.150.0090.01017.40
7.4.140.0110.01217.86
7.4.130.0130.00416.91
7.4.120.0090.01216.79
7.4.110.0200.00316.81
7.4.100.0110.00816.77
7.4.90.0060.01116.99
7.4.80.0130.00719.39
7.4.70.0110.01116.72
7.4.60.0060.01016.73
7.4.50.0000.01316.88
7.4.40.0110.00716.69
7.4.00.0050.01115.14
7.3.330.0000.00513.48
7.3.320.0000.00613.58
7.3.310.0030.00316.61
7.3.300.0030.00316.71
7.3.290.0190.00616.64
7.3.280.0020.01316.69
7.3.270.0090.00917.40
7.3.260.0120.00716.75
7.3.250.0090.00916.76
7.3.240.0150.00516.74
7.3.230.0100.00716.77
7.3.210.0110.00516.64
7.3.200.0100.00616.72
7.3.190.0130.01016.80
7.3.180.0100.00716.69
7.3.170.0070.01016.66
7.3.160.0070.01016.73
7.3.120.0090.00614.97
7.3.110.0030.01015.08
7.3.100.0060.00814.90
7.3.90.0090.00514.81
7.3.80.0040.01114.91
7.3.70.0050.01014.95
7.3.60.0020.01114.92
7.3.50.0100.00514.81
7.3.40.0080.00714.76
7.3.30.0070.00614.99
7.3.20.0070.00716.81
7.3.10.0060.00716.72
7.3.00.0060.00816.68
7.2.330.0190.00017.09
7.2.320.0140.01017.09
7.2.310.0090.01317.01
7.2.300.0100.00716.71
7.2.290.0100.00716.80
7.2.250.0070.01115.10
7.2.240.0100.00515.12
7.2.230.0030.01215.35
7.2.220.0030.01015.21
7.2.210.0040.01115.05
7.2.200.0080.00815.14
7.2.190.0050.00915.04
7.2.180.0070.00715.01
7.2.170.0070.00615.16
7.2.160.0030.01215.14
7.2.150.0060.00917.07
7.2.140.0090.00616.95
7.2.130.0090.00516.92
7.2.120.0090.00717.03
7.2.110.0070.01016.99
7.2.100.0070.00917.08
7.2.90.0060.00816.98
7.2.80.0080.00817.01
7.2.70.0070.01116.68
7.2.60.0060.01116.97
7.2.50.0050.00917.05
7.2.40.0040.01117.04
7.2.30.0050.00817.04
7.2.20.0080.00516.98
7.2.10.0080.00716.99
7.2.00.0090.01217.81
7.1.330.0050.01015.75
7.1.320.0020.01415.94
7.1.310.0080.00615.90
7.1.300.0050.00715.79
7.1.290.0050.00616.00
7.1.280.0050.00916.01
7.1.270.0020.01015.87
7.1.260.0030.01015.88
7.1.250.0060.00715.94
7.1.200.0000.01216.02
7.1.120.0120.01217.92
7.1.110.0230.00817.33
7.1.100.0160.00917.33
7.1.90.0150.00617.15
7.1.80.0090.01417.10
7.1.70.0130.01416.37
7.1.60.0230.01434.33
7.1.50.0290.01133.95
7.1.40.0290.00933.66
7.1.30.0280.01133.73
7.1.20.0280.00933.83
7.1.10.0140.00815.87
7.1.00.0100.01015.83

preferences:
56.1 ms | 401 KiB | 5 Q