3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <table> <tbody id="threadbits_forum_26"> <tr> <td class="alt1"> <a href="http://www.example1.com">test1</a> </td> </tr> <tr> <td class="alt1"> <a href="http://www.example2.com">test2</a> </td> </tr> <tr> <td class="alt1"> <a href="http://www.example3.com">test3</a> </td> </tr> <tr> <td class="alt1"> <a href="http://www.example4.com">test4</a> </td> </tr> <tr> <td class="alt1"> <a href="http://www.example5.com">test5</a> </td> </tr> <tr> <td class="alt1"> <a href="http://www.example6.com">test6</a> </td> </tr> </tbody> </table> HTML; $dom=new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $result = ''; foreach ($xpath->evaluate("//td[@class='alt1']/a") as $i => $node) { // target a tags that have <td class="alt1"> as parent if ($i > 1) { // disqualify first two nodes $result .= "\t<li class=\"itemtitle\"><a href=\"{$node->getAttribute('href')}\" target=\"_blank\">{$node->nodeValue}</a></li>\n"; if ($i == 12) { break; } // set a limit of 10 rows of data (#3 to #13) } } if ($result) { echo "<ul>\n$result</ul>"; }

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.0060.00318.54
8.5.00.0150.00920.34
8.4.160.0140.00824.24
8.4.150.0010.00114.05
8.4.140.0100.01017.97
8.4.130.0070.00618.31
8.4.120.0120.00820.97
8.4.110.0140.00622.70
8.4.100.0050.00618.15
8.4.90.0110.00820.03
8.4.80.0150.00518.14
8.4.70.0100.01018.28
8.4.60.0150.00718.04
8.4.50.0100.00819.85
8.4.40.0120.00317.90
8.4.30.0100.01020.07
8.4.20.0100.01019.97
8.4.10.0100.01020.06
8.3.280.0130.00818.76
8.3.270.0100.01017.10
8.3.260.0110.01016.84
8.3.250.0070.01219.11
8.3.240.0110.00917.00
8.3.230.0090.00717.23
8.3.220.0140.00517.64
8.3.210.0060.00917.05
8.3.200.0110.00817.05
8.3.190.0100.01017.14
8.3.180.0110.00719.51
8.3.170.0040.00417.01
8.3.160.0150.00318.99
8.3.150.0070.01319.04
8.3.140.0090.00917.54
8.3.130.0080.00018.71
8.3.120.0030.00719.60
8.3.110.0130.00720.94
8.3.100.0030.00724.06
8.3.90.0080.00026.77
8.3.80.0070.00318.80
8.3.70.0060.00917.00
8.3.60.0190.00318.53
8.3.50.0050.01117.86
8.3.40.0160.00019.20
8.3.30.0140.00719.13
8.3.20.0030.00522.09
8.3.10.0050.00324.04
8.3.00.0000.00823.89
8.2.290.0120.00720.91
8.2.280.0110.00817.35
8.2.270.0160.00317.67
8.2.260.0000.00817.16
8.2.250.0040.00417.20
8.2.240.0050.00517.51
8.2.230.0000.00822.58
8.2.220.0050.00337.54
8.2.210.0000.00826.77
8.2.200.0060.00318.91
8.2.190.0000.01816.88
8.2.180.0090.00916.75
8.2.170.0060.00922.96
8.2.160.0070.01019.96
8.2.150.0000.00924.18
8.2.140.0090.00024.66
8.2.130.0080.00019.75
8.2.120.0040.00426.35
8.2.110.0060.00322.59
8.2.100.0090.00318.41
8.2.90.0030.00518.25
8.2.80.0080.00019.28
8.2.70.0050.00318.39
8.2.60.0080.00018.13
8.2.50.0080.00018.72
8.2.40.0080.00021.02
8.2.30.0070.00020.93
8.2.20.0050.00318.60
8.2.10.0040.00418.59
8.2.00.0000.00818.39
8.1.330.0090.01018.77
8.1.320.0090.01016.53
8.1.310.0070.00018.90
8.1.300.0140.00419.94
8.1.290.0060.00330.84
8.1.280.0140.00325.92
8.1.270.0040.00422.61
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00324.21
8.1.230.0040.00718.26
8.1.220.0040.00418.29
8.1.210.0030.00618.77
8.1.200.0070.00317.72
8.1.190.0040.00417.72
8.1.180.0050.00318.10
8.1.170.0000.00818.99
8.1.160.0000.00719.29
8.1.150.0040.00422.34
8.1.140.0000.00718.00
8.1.130.0040.00419.49
8.1.120.0040.00417.89
8.1.110.0000.00817.87
8.1.100.0040.00417.81
8.1.90.0070.00017.89
8.1.80.0060.00317.85
8.1.70.0070.00017.81
8.1.60.0060.00317.91
8.1.50.0080.00017.82
8.1.40.0020.00517.98
8.1.30.0000.00818.12
8.1.20.0030.00518.07
8.1.10.0040.00417.99
8.1.00.0000.00917.83
8.0.300.0040.00418.77
8.0.290.0030.00617.13
8.0.280.0000.00718.74
8.0.270.0000.00717.71
8.0.260.0030.00317.38
8.0.250.0040.00417.36
8.0.240.0030.00317.42
8.0.230.0000.00717.44
8.0.220.0030.00317.37
8.0.210.0040.00417.35
8.0.200.0030.00317.41
8.0.190.0030.00617.24
8.0.180.0080.00017.34
8.0.170.0040.00417.25
8.0.160.0000.00717.32
8.0.150.0000.00717.34
8.0.140.0070.00017.19
8.0.130.0050.00213.76
8.0.120.0040.00417.37
8.0.110.0070.00017.50
8.0.100.0040.00417.27
8.0.90.0000.00817.36
8.0.80.0030.01317.36
8.0.70.0040.00417.23
8.0.60.0040.00417.13
8.0.50.0050.00317.17
8.0.30.0150.00317.63
8.0.20.0180.00317.70
8.0.10.0040.00417.41
8.0.00.0120.00617.19
7.4.330.0030.00315.55
7.4.320.0070.00516.84
7.4.300.0000.00616.99
7.4.290.0040.00416.87
7.4.280.0000.00917.00
7.4.270.0040.00416.94
7.4.260.0000.00716.95
7.4.250.0080.00016.92
7.4.240.0000.00716.98
7.4.230.0000.00717.11
7.4.220.0030.00516.80
7.4.210.0060.01316.98
7.4.200.0050.00316.94
7.4.160.0080.01016.90
7.4.140.0090.00917.86
7.4.130.0120.00916.88
7.4.120.0110.00716.95
7.4.110.0150.00317.00
7.4.100.0100.01316.95
7.4.90.0120.00916.93
7.4.80.0140.00819.39
7.4.70.0070.01016.87
7.4.60.0100.00716.80
7.4.50.0110.00716.76
7.4.40.0160.00016.79
7.4.00.0080.01115.25
7.3.330.0030.00313.61
7.3.320.0070.00013.65
7.3.310.0030.00316.86
7.3.300.0040.00416.62
7.3.290.0050.00316.71
7.3.280.0110.00716.74
7.3.260.0100.00916.81
7.3.240.0090.01016.91
7.3.230.0080.01116.94
7.3.210.0070.01016.85
7.3.200.0150.00616.75
7.3.190.0030.01316.64
7.3.180.0110.00516.98
7.3.170.0110.00616.99
7.3.160.0030.01316.84
7.3.120.0080.00815.18
7.3.110.0070.01214.93
7.3.100.0050.00914.96
7.3.90.0060.00815.25
7.3.80.0090.00415.16
7.3.70.0060.00415.04
7.3.60.0070.00915.04
7.3.50.0020.01115.18
7.3.40.0070.00515.01
7.3.30.0000.01115.18
7.3.20.0070.00816.83
7.3.10.0070.00816.71
7.3.00.0050.01116.91
7.2.330.0110.00717.16
7.2.320.0100.01317.12
7.2.310.0070.01017.05
7.2.300.0180.00617.11
7.2.290.0060.01217.14
7.2.250.0050.01415.30
7.2.240.0090.00515.18
7.2.230.0070.00815.13
7.2.220.0030.01215.29
7.2.210.0050.00915.28
7.2.200.0050.01015.16
7.2.190.0060.00915.19
7.2.180.0030.01015.09
7.2.170.0070.00915.28
7.2.60.0080.00316.95
7.2.30.0080.01920.13
7.2.20.0100.01820.21
7.2.10.0110.01419.74
7.2.00.0110.01319.72
7.1.330.0060.00616.03
7.1.320.0060.00816.08
7.1.310.0040.01116.11
7.1.300.0090.00515.79
7.1.290.0040.00815.92
7.1.280.0010.01015.93
7.1.270.0050.00715.89
7.1.260.0080.00415.99
7.1.200.0090.00315.84
7.1.150.0070.01218.97
7.1.140.0090.00918.88
7.1.130.0110.01218.57
7.1.120.0070.01618.90
7.1.110.0080.01418.12
7.1.100.0100.01218.17
7.1.90.0110.01017.95
7.1.80.0070.00817.76
7.1.70.0110.01017.10
7.1.60.0340.01535.23
7.1.50.0310.01534.88
7.1.40.0350.01434.60
7.1.30.0290.01734.64
7.1.20.0310.02134.67
7.1.10.0060.01616.72
7.1.00.0060.01416.88

preferences:
28.42 ms | 403 KiB | 5 Q