3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = <<<HTML <body> <img class="size-full aligncenter" src="image-name1.jpg" alt="" width="799" height="449"> <img class="size-full aligncenter" src="image-name2.jpg" alt="" width="799" height="449"> <img class="size-full aligncenter" src="image-name3.jpg" alt="" width="799" height="449"> </body> HTML; $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); foreach ($xpath->query('//img[@alt=""]') as $img) { $img->setAttribute( 'alt', pathinfo( $img->getAttribute('src'), PATHINFO_FILENAME ) ); } 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.60.0110.00717.04
8.5.50.0110.00618.70
8.5.30.0070.01120.48
8.5.20.0060.01220.05
8.5.10.0160.00318.91
8.5.00.0150.00620.45
8.4.210.0130.00920.09
8.4.180.0150.00719.82
8.4.170.0170.00524.15
8.4.160.0120.00924.10
8.4.150.0080.00517.10
8.4.140.0180.01017.90
8.4.130.0070.00318.23
8.4.120.0040.00421.07
8.4.110.0110.00919.58
8.4.100.0130.00917.96
8.4.90.0050.00418.30
8.4.80.0130.00718.21
8.4.70.0070.01318.13
8.4.60.0140.01119.01
8.4.50.0120.00824.04
8.4.40.0080.00418.30
8.4.30.0100.00918.86
8.4.20.0130.00320.74
8.4.10.0030.00622.47
8.3.300.0090.00221.25
8.3.290.0140.00721.04
8.3.280.0100.01018.59
8.3.270.0140.00516.86
8.3.260.0050.01116.77
8.3.250.0060.01319.21
8.3.240.0050.00416.92
8.3.230.0050.00417.03
8.3.220.0080.00217.79
8.3.210.0120.00716.91
8.3.200.0040.00517.49
8.3.190.0120.00719.39
8.3.180.0090.01116.84
8.3.170.0050.00317.12
8.3.160.0070.01116.97
8.3.150.0160.00317.54
8.3.140.0070.01117.38
8.3.130.0000.00816.96
8.3.120.0040.00419.45
8.3.110.0060.00320.94
8.3.100.0100.00024.06
8.3.90.0000.00826.77
8.3.80.0060.00317.13
8.3.70.0120.00616.86
8.3.60.0120.00617.13
8.3.50.0120.00620.32
8.3.40.0120.00918.91
8.3.30.0090.00618.95
8.3.20.0080.00024.18
8.3.10.0080.00024.66
8.3.00.0030.00526.16
8.2.300.0140.00818.38
8.2.290.0090.01120.88
8.2.280.0100.00918.71
8.2.270.0100.01017.24
8.2.260.0030.00519.61
8.2.250.0050.00317.28
8.2.240.0090.00017.44
8.2.230.0030.00622.58
8.2.220.0000.00937.54
8.2.210.0110.00726.77
8.2.200.0090.00316.88
8.2.190.0180.00016.88
8.2.180.0200.00725.92
8.2.170.0120.00619.34
8.2.160.0100.00322.96
8.2.150.0000.00825.66
8.2.140.0000.00824.66
8.2.130.0030.00626.16
8.2.120.0070.01120.27
8.2.110.0060.00320.77
8.2.100.0060.00618.16
8.2.90.0060.00318.48
8.2.80.0080.00018.53
8.2.70.0040.00418.00
8.2.60.0000.00818.00
8.2.50.0080.00017.88
8.2.40.0090.00319.03
8.2.30.0080.00418.00
8.2.20.0070.00519.21
8.2.10.0090.00418.11
8.2.00.0100.00218.40
8.1.340.0120.00720.20
8.1.330.0120.00718.85
8.1.320.0120.00816.36
8.1.310.0110.00418.63
8.1.300.0040.01518.11
8.1.290.0060.00318.88
8.1.280.0150.00625.92
8.1.270.0090.00022.52
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0110.00022.50
8.1.230.0040.00822.53
8.1.220.0090.00018.16
8.1.210.0030.00519.16
8.1.200.0040.00417.85
8.1.190.0030.00617.85
8.1.180.0030.00618.10
8.1.170.0110.00218.21
8.1.160.0070.00519.32
8.1.150.0090.00518.31
8.1.140.0080.00517.66
8.1.130.0100.00118.07
8.1.120.0070.00517.68
8.1.110.0070.00517.71
8.1.100.0080.00517.72
8.1.90.0050.00717.72
8.1.80.0050.00718.22
8.1.70.0100.00417.72
8.1.60.0150.00117.81
8.1.50.0100.00517.74
8.1.40.0090.00417.86
8.1.30.0090.00518.25
8.1.20.0090.00517.80
8.1.10.0080.00617.83
8.1.00.0110.00317.72
8.0.300.0040.00420.34
8.0.290.0040.00417.25
8.0.280.0070.00518.21
8.0.270.0040.00617.31
8.0.260.0040.00617.73
8.0.250.0070.00217.80
8.0.240.0090.00217.74
8.0.230.0050.00517.33
8.0.220.0040.00617.30
8.0.210.0040.00617.40
8.0.200.0070.00517.31
8.0.190.0080.00517.32
8.0.180.0050.00817.32
8.0.170.0100.00317.36
8.0.160.0060.00717.34
8.0.150.0100.00317.22
8.0.140.0090.00417.27
8.0.130.0080.00517.29
8.0.120.0070.00517.28
8.0.110.0080.00517.29
8.0.100.0060.00717.28
8.0.90.0100.00417.29
8.0.80.0080.00517.75
8.0.70.0100.00317.27
8.0.60.0070.00617.29
8.0.50.0060.00617.35
8.0.30.0090.00217.31
8.0.20.0070.00517.35
8.0.10.0110.00417.40
7.4.330.0060.00616.27
7.4.320.0090.00617.08
7.4.300.0140.00417.04
7.4.290.0150.00317.01
7.4.280.0110.00617.03
7.4.270.0130.00317.06
7.4.260.0090.00516.99
7.4.250.0100.00517.08
7.4.240.0130.00417.00
7.4.230.0120.00417.00
7.4.220.0090.00616.92
7.4.210.0100.00517.02
7.4.200.0110.00417.04
7.4.190.0110.00417.10
7.4.180.0070.00817.08
7.4.160.0100.00517.05
7.4.150.0120.00317.01
7.4.140.0060.00917.00
7.4.130.0130.00217.00
7.4.120.0130.00216.98
7.4.110.0130.00216.96
7.4.100.0120.00216.97
7.4.90.0090.00516.94
7.4.80.0090.00516.91
7.4.70.0100.00516.95
7.4.60.0090.00616.97
7.4.50.0110.00416.88
7.4.40.0080.00616.86
7.4.30.0120.00316.91
7.4.20.0080.00616.87
7.4.10.0080.00716.91
7.4.00.0080.00616.92

preferences:
45.05 ms | 1307 KiB | 5 Q