3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<table> <tr class="rules-details" style="display: none"> <td colspan="4"> <a href="/serve-scaled-images.html" class="rule-help btn hover-tooltip" data-tooltip-interactive data-tooltip-max-width="450" title="&lt;h4&gt;Serve scaled images&lt;/h4&gt;&lt;p&gt;Serving appropriately-sized images can save many bytes of data and improve the performance of your webpage, especially on low-powered (eg. mobile) devices.&lt;/p&gt;&lt;p class=&quot;rule-help-tooltip-more&quot;&gt;&lt;a href=&quot;/serve-scaled-images.html&quot;&gt;Read more&lt;/a&gt;&lt;/p&gt;"><i class="sprite-question"></i><span class="resp-hidden">What\'s this mean?</span></a> <div> <p>The following images are resized in HTML or CSS. Serving scaled images could save 1.3MiB (45% reduction). <ul> <li><a href="https://www.example.com/Pictures/thumbs/0029.jpg" target="_blank" rel="nofollow noopener noreferrer">https://www.example.com/Pictures/thumbs/0029.jpg</a> is resized in HTML or CSS from 300x623 to 123x200. Serving a scaled image could save 51.3KiB (86% reduction).</li> <li><a href="https://www.example.com/Pictures/thumbs/0133.jpg" target="_blank" rel="nofollow noopener noreferrer">https://www.example.com/Pictures/thumbs/0133.jpg</a> is resized in HTML or CSS from 300x578 to 135x200. Serving a scaled image could save 44.0KiB (84% reduction).</li> <li><a href="https://www.example.com/Pictures/thumbs/0075.jpg" target="_blank" rel="nofollow noopener noreferrer">https://www.example.com/Pictures/thumbs/0075.jpg</a> is resized in HTML or CSS from 300x390 to 176x200. Serving a scaled image could save 43.2KiB (69% reduction).</li> <li><a href="https://www.example.com/Pictures/thumbs/0057.jpg" target="_blank" rel="nofollow noopener noreferrer">https://www.example.com/Pictures/thumbs/0057.jpg</a> is resized in HTML or CSS from 300x436 to 174x200. Serving a scaled image could save 35.0KiB (73% reduction).</li> <li><a href="https://www.example.com/Pictures/thumb/thumb.png" target="_blank" rel="nofollow noopener noreferrer">https://www.example.com/Pictures/thumbs/thumb.png</a> is resized in HTML or CSS from 148x100 to 68x46. Serving a scaled image could save 31.4KiB (78% reduction).</li> <li><a href="https://www.example.com/Pictures/thumb/thumb.png" target="_blank" rel="nofollow noopener noreferrer">https://www.example.com/Pictures/thumbs/thumb.png</a> is resized in HTML or CSS from 148x100 to 68x46. Serving a scaled image could save 30.9KiB (78% reduction).</li> <li><a href="https://www.example.com/Pictures/thumb/thumb.png" target="_blank" rel="nofollow noopener noreferrer">https://www.example.com/Pictures/thumbs/thumb.png</a> is resized in HTML or CSS from 148x100 to 68x46. Serving a scaled image could save 30.7KiB (78% reduction).</li> <li><a href="https://www.example.com/Pictures/thumb/thumb.png" target="_blank" rel="nofollow noopener noreferrer">https://www.example.com/Pictures/thumbs/thumb.png</a> is resized in HTML or CSS from 148x100 to 68x46. Serving a scaled image could save 30.7KiB (78% reduction).</li> <li><a href="https://www.example.com/Pictures/thumbs/0093.jpg" target="_blank" rel="nofollow noopener noreferrer">https://www.example.com/Pictures/thumbs/0093.jpg</a> is resized in HTML or CSS from 300x458 to 138x200. Serving a scaled image could save 28.9KiB (79% reduction).</li> </ul> </p> </div> </td> </tr> </table>'; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML($html); $xpath = new DOMXPath($dom); $result = []; foreach ($xpath->query('//tr/td/div//ul/li/a') as $a) { $result[] = [$a->nodeValue, preg_match('~to \K\d+x\d+~', $a->parentNode->nodeValue, $m) ? $m[0] : '']; } var_export($result);

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.0120.00317.50
8.3.50.0120.00416.89
8.3.40.0140.00019.80
8.3.30.0120.00319.64
8.3.20.0050.00324.18
8.3.10.0050.00324.66
8.3.00.0060.00326.16
8.2.180.0160.00325.92
8.2.170.0160.00019.70
8.2.160.0030.01222.96
8.2.150.0050.00325.66
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0070.00021.48
8.2.110.0030.00722.75
8.2.100.0130.00418.39
8.2.90.0080.00018.47
8.2.80.0060.00319.79
8.2.70.0060.00318.38
8.2.60.0040.00418.38
8.2.50.0040.00419.97
8.2.40.0040.00420.09
8.2.30.0050.00318.59
8.2.20.0040.00418.51
8.2.10.0000.00719.91
8.2.00.0030.00519.79
8.1.280.0090.00625.92
8.1.270.0000.00823.99
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0060.00324.46
8.1.230.0030.01022.88
8.1.220.0040.00418.28
8.1.210.0040.00419.29
8.1.200.0000.00817.98
8.1.190.0040.00417.73
8.1.180.0030.00618.10
8.1.170.0050.00318.13
8.1.160.0050.00319.45
8.1.150.0000.00719.44
8.1.140.0000.00719.48
8.1.130.0030.00518.07
8.1.120.0040.00418.07
8.1.110.0050.00318.07
8.1.100.0000.00818.09
8.1.90.0000.00718.11
8.1.80.0030.00618.05
8.1.70.0000.00718.01
8.1.60.0030.00618.25
8.1.50.0000.00818.19
8.1.40.0030.00518.14
8.1.30.0050.00318.26
8.1.20.0060.00318.29
8.1.10.0090.00018.25
8.1.00.0030.00518.18
8.0.300.0070.00020.54
8.0.290.0000.00817.50
8.0.280.0000.00818.81
8.0.270.0050.00318.61
8.0.260.0000.00717.29
8.0.250.0000.00817.44
8.0.240.0030.00317.44
8.0.230.0050.00317.56
8.0.220.0030.00617.52
8.0.210.0000.00717.36
8.0.200.0000.00717.50
8.0.190.0030.00617.45
8.0.180.0000.00817.56
8.0.170.0060.00617.50
8.0.160.0040.00417.45
8.0.150.0040.00417.31
8.0.140.0000.00717.37
8.0.130.0030.00313.93
8.0.120.0050.00317.34
8.0.110.0060.00317.44
8.0.100.0080.00017.54
8.0.90.0050.00217.16
8.0.80.0060.01217.46
8.0.70.0040.00417.20
8.0.60.0050.00317.34
8.0.50.0000.00817.32
8.0.30.0100.01617.83
8.0.20.0140.01017.50
8.0.10.0020.00517.71
8.0.00.0060.01217.24
7.4.330.0050.00015.63
7.4.320.0060.00017.16
7.4.300.0000.00617.13
7.4.290.0000.00717.07
7.4.280.0080.00017.07
7.4.270.0000.00717.28
7.4.260.0000.00514.02
7.4.250.0020.00517.25
7.4.240.0040.00417.23
7.4.230.0090.00017.01
7.4.220.0050.00216.99
7.4.210.0070.00717.12
7.4.200.0060.00317.29
7.4.130.0100.01217.07
7.4.120.0060.01517.18
7.4.110.0000.01817.06
7.4.100.0040.01417.30
7.4.90.0080.01216.85
7.4.80.0090.01219.39
7.4.70.0100.00717.13
7.4.60.0090.00917.17
7.4.50.0030.01317.27
7.4.40.0030.01316.81
7.4.30.0030.01417.08
7.4.20.0140.00317.14
7.4.10.0090.01016.85
7.4.00.0070.01017.28
7.3.330.0080.00016.91
7.3.320.0050.00013.56
7.3.310.0040.00417.01
7.3.300.0030.00316.96
7.3.290.0050.01216.79
7.3.280.0060.01316.70
7.3.260.0160.00916.99
7.3.240.0090.01016.93
7.3.230.0050.01416.91
7.3.210.0110.00616.81
7.3.200.0210.00317.13
7.3.190.0030.01416.89
7.3.180.0030.01316.87
7.3.170.0030.01316.83
7.3.160.0090.00616.85
7.3.150.0060.01016.90
7.3.140.0080.00917.14
7.3.130.0090.00617.06
7.3.120.0030.01216.76
7.3.110.0100.00616.99
7.3.100.0160.00017.21
7.3.90.0100.00717.00
7.3.80.0090.00616.76
7.3.70.0060.00916.95
7.3.60.0100.00616.92
7.3.50.0120.00416.79
7.3.40.0060.01216.95
7.3.30.0100.00716.95
7.3.20.0090.00916.89
7.3.10.0070.01016.86
7.3.00.0040.01416.83
7.2.330.0000.01817.25
7.2.320.0120.00617.28
7.2.310.0150.00917.16
7.2.300.0100.00617.27
7.2.290.0070.01017.34
7.2.280.0120.00617.42
7.2.270.0120.00617.09
7.2.260.0030.01317.18
7.2.250.0060.01217.34
7.2.240.0080.01017.30
7.2.230.0130.00317.25
7.2.220.0100.01117.28
7.2.210.0090.01217.23
7.2.200.0110.00517.09
7.2.190.0000.02317.06
7.2.180.0030.01317.06
7.2.170.0060.01217.29
7.2.160.0070.01117.19
7.2.150.0140.00417.47
7.2.140.0140.00617.14
7.2.130.0140.00417.34
7.2.120.0100.00717.27
7.2.110.0070.01017.18
7.2.100.0070.01017.33
7.2.90.0110.01117.39
7.2.80.0040.01417.07
7.2.70.0100.00717.18
7.2.60.0120.00617.26
7.2.50.0090.00917.05
7.2.40.0150.01217.18
7.2.30.0040.01517.20
7.2.20.0060.01217.22
7.2.10.0070.01017.28
7.2.00.0100.00717.26

preferences:
56.44 ms | 400 KiB | 5 Q