3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_SESSION["caserma"] = <<<HTML <table cellspacing="1" cellpadding="1" class="troop_details inReturn" > <thead> <tr> <td class="role"> <a href="/karte.php?d=91628">01] #WorkInProgress</a> </td> <td colspan="11" class="troopHeadline"> <a href="/karte.php?d=91611">Return from 01-soldier</a> </td> </tr> </thead> <tbody class="units"> <tr> <th class="coords"> &#x202d;<span class="coordinates coordinatesWrapper coordinatesAligned coordinatesltr"><span class="coordinateX">(&#x202d;&minus;&#x202d;1&#x202c;&#x202c;</span><span class="coordinatePipe">|</span><span class="coordinateY">&#x202d;&minus;&#x202d;28&#x202c;&#x202c;)</span></span>&#x202c; </th> <td class="uniticon"> <img class="unit u21" title="Phalanx: 1:12:51" alt="Phalanx" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u22" title="Swordsman: 1:25:00" alt="Swordsman" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u23" title="Pathfinder: 0:30:00" alt="Pathfinder" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u24" title="Theutates Thunder: 0:26:51" alt="Theutates Thunder" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u25" title="Druidrider: 0:31:53" alt="Druidrider" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u26" title="Haeduan: 0:39:14" alt="Haeduan" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u27" title="Ram: 2:07:30" alt="Ram" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u28" title="Trebuchet: 2:50:00" alt="Trebuchet" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u29" title="Chieftain: 1:42:00" alt="Chieftain" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u30" title="Settler: 1:42:00" alt="Settler" src="/img/x.gif" /> </td> <td class="uniticon last"> <img class="unit uhero" title="Hero" alt="Hero" src="/img/x.gif" /> </td> </tr> </tbody> <tbody class="units last"> <tr> <th>Troops</th> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit"> 500 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none last"> 0 </td> </tr> </tbody> <tbody class="infos"> <tr> <th>Bounty</th> <td colspan="11"> <div class="res"> <div class="inlineIconList resourceWrapper"><div class="inlineIcon resources" title="Lumber"><i class="r1"></i><span class="value ">6758</span></div><div class="inlineIcon resources" title="Clay"><i class="r2"></i><span class="value ">8093</span></div><div class="inlineIcon resources" title="Iron"><i class="r3"></i><span class="value ">6908</span></div><div class="inlineIcon resources" title="Crop"><i class="r4"></i><span class="value ">15741</span></div></div> </div> <div class="carry"> <img class="carry full" title="carry" alt="carry" src="/img/x.gif"/> &#x202d;&#x202d;37500&#x202c;&nbsp;/&nbsp;&#x202d;37500&#x202c;&#x202c; </div> </td> </tr> </tbody> <tbody class="infos"> <tr> <th>Arrival</th> <td colspan="11"> <div class="in">in&nbsp;<span class="timer" counting="down" value="85">0:01:25</span>&nbsp;hrs.</div> <div class="at"><span>at&nbsp;00:43:10</span><span> </span></div> </td> </tr> </tbody> </table> <a name="at"></a> <table cellspacing="1" cellpadding="1" class="troop_details inReturn" > <thead> <tr> <td class="role"> <a href="/karte.php?d=91628">01] #WorkInProgress</a> </td> <td colspan="11" class="troopHeadline"> <a href="/karte.php?d=94829">Return from 0-New Hulk</a> </td> </tr> </thead> <tbody class="units"> <tr> <th class="coords"> &#x202d;<span class="coordinates coordinatesWrapper coordinatesAligned coordinatesltr"><span class="coordinateX">(&#x202d;&minus;&#x202d;1&#x202c;&#x202c;</span><span class="coordinatePipe">|</span><span class="coordinateY">&#x202d;&minus;&#x202d;28&#x202c;&#x202c;)</span></span>&#x202c; </th> <td class="uniticon"> <img class="unit u21" title="Phalanx: 0:45:33" alt="Phalanx" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u22" title="Swordsman: 0:53:09" alt="Swordsman" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u23" title="Pathfinder: 0:18:46" alt="Pathfinder" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u24" title="Theutates Thunder: 0:16:47" alt="Theutates Thunder" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u25" title="Druidrider: 0:19:56" alt="Druidrider" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u26" title="Haeduan: 0:24:32" alt="Haeduan" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u27" title="Ram: 1:19:44" alt="Ram" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u28" title="Trebuchet: 1:46:18" alt="Trebuchet" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u29" title="Chieftain: 1:03:47" alt="Chieftain" src="/img/x.gif" /> </td> <td class="uniticon"> <img class="unit u30" title="Settler: 1:03:47" alt="Settler" src="/img/x.gif" /> </td> <td class="uniticon last"> <img class="unit uhero" title="Hero" alt="Hero" src="/img/x.gif" /> </td> </tr> </tbody> <tbody class="units last"> <tr> <th>Troops</th> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit"> 400 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none"> 0 </td> <td class="unit none last"> 0 </td> </tr> </tbody> <tbody class="infos"> <tr> <th>Bounty</th> <td colspan="11"> <div class="res"> <div class="inlineIconList resourceWrapper"><div class="inlineIcon resources" title="Lumber"><i class="r1"></i><span class="value ">6130</span></div><div class="inlineIcon resources" title="Clay"><i class="r2"></i><span class="value ">5835</span></div><div class="inlineIcon resources" title="Iron"><i class="r3"></i><span class="value ">5638</span></div><div class="inlineIcon resources" title="Crop"><i class="r4"></i><span class="value ">12397</span></div></div> </div> <div class="carry"> <img class="carry full" title="carry" alt="carry" src="/img/x.gif"/> &#x202d;&#x202d;30000&#x202c;&nbsp;/&nbsp;&#x202d;30000&#x202c;&#x202c; </div> </td> </tr> </tbody> <tbody class="infos"> <tr> <th>Arrival</th> <td colspan="11"> <div class="in">in&nbsp;<span class="timer" counting="down" value="920">0:15:20</span>&nbsp;hrs.</div> <div class="at"><span>at&nbsp;00:57:05</span><span> </span></div> </td> </tr> </tbody> </table> HTML; $dom = new DOMDocument; libxml_use_internal_errors(true); $dom->loadHTML($_SESSION["caserma"]); $xpath = new DOMXPath($dom); $texts = []; foreach ($xpath->query("//table[contains(@class, 'troop_details') and contains(@class, 'inReturn')]") as $table) { $tablePath = $table->getNodePath(); $texts[] = [ 'troopHeadline' => $xpath->query($tablePath . "//td[@class='troopHeadline']//a[@href]/text()")[0]->nodeValue, 'atTime' => substr($xpath->query($tablePath . "//div[@class='at']/span[starts-with(text(), 'at')]/text()")[0]->nodeValue, -8) ]; } var_export($texts);

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.4.130.0110.01019.43
8.4.120.0120.00924.82
8.4.110.0050.00420.17
8.4.100.0120.00919.24
8.4.90.0090.01421.29
8.4.80.0050.00419.33
8.4.70.0100.01218.51
8.4.60.0090.01319.59
8.4.50.0060.00319.47
8.4.40.0070.01418.39
8.4.30.0080.00820.99
8.4.20.0150.00618.25
8.4.10.0050.00522.99
8.3.250.0130.00719.56
8.3.240.0040.00517.96
8.3.230.0030.00617.31
8.3.220.0130.00719.80
8.3.210.0100.00518.97
8.3.200.0110.00917.59
8.3.190.0110.00917.72
8.3.180.0100.01117.77
8.3.170.0160.00421.44
8.3.160.0130.00719.05
8.3.150.0080.01217.39
8.3.140.0090.00017.79
8.3.130.0090.00017.25
8.3.120.0080.00419.45
8.3.110.0030.00720.94
8.3.100.0100.00724.06
8.3.90.0130.00926.77
8.3.80.0110.00017.25
8.3.70.0100.00618.93
8.3.60.0070.01017.25
8.3.50.0110.00923.94
8.3.40.0040.01519.51
8.3.30.0040.01219.29
8.3.20.0040.00424.18
8.3.10.0060.00324.66
8.3.00.0030.00626.16
8.2.290.0110.00620.98
8.2.280.0110.01219.15
8.2.270.0060.00319.70
8.2.260.0090.00017.02
8.2.250.0120.00919.08
8.2.240.0000.00917.84
8.2.230.0130.00322.58
8.2.220.0080.00337.54
8.2.210.0160.00326.77
8.2.200.0100.00017.13
8.2.190.0070.01017.00
8.2.180.0120.00925.92
8.2.170.0130.00919.66
8.2.160.0100.01322.96
8.2.150.0040.01125.66
8.2.140.0170.00024.66
8.2.130.0030.00626.16
8.2.120.0080.00021.87
8.2.110.0060.00321.68
8.2.100.0040.00818.34
8.2.90.0090.00018.34
8.2.80.0060.00318.55
8.2.70.0030.00618.13
8.2.60.0000.00818.29
8.2.50.0000.00918.13
8.2.40.0050.00518.59
8.2.30.0060.00318.63
8.2.20.0030.00518.50
8.2.10.0030.00619.78
8.2.00.0000.00819.82
8.1.330.0100.01122.44
8.1.320.0150.01118.48
8.1.310.0100.00619.07
8.1.300.0030.00618.57
8.1.290.0000.01018.88
8.1.280.0030.01925.92
8.1.270.0000.00824.50
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00024.25
8.1.230.0090.00321.51
8.1.220.0060.00318.29
8.1.210.0030.00719.26
8.1.200.0050.00518.10
8.1.190.0030.00617.98
8.1.180.0030.00618.10
8.1.170.0050.00519.06
8.1.160.0030.00519.51
8.1.150.0030.00519.53
8.1.140.0030.00621.15
8.1.130.0030.00520.55
8.1.120.0040.00818.00
8.1.110.0000.00918.02
8.1.100.0000.00917.92
8.1.90.0060.00318.02
8.1.80.0040.00418.00
8.1.70.0020.00517.98
8.1.60.0030.00718.05
8.1.50.0040.00418.10
8.1.40.0040.00418.05
8.1.30.0090.00018.22
8.1.20.0040.00418.20
8.1.10.0030.00618.16
8.1.00.0030.00617.98
8.0.300.0040.00420.23
8.0.290.0090.00017.13
8.0.280.0080.00020.73
8.0.270.0000.00718.65
8.0.260.0000.00718.96
8.0.250.0060.00317.59
8.0.240.0050.00217.45
8.0.230.0040.00417.61
8.0.220.0000.00817.41
8.0.210.0000.00817.57
8.0.200.0030.00517.47
8.0.190.0040.00417.61
8.0.180.0080.00017.51
8.0.170.0040.00417.36
8.0.160.0000.00817.43
8.0.150.0080.00417.57
8.0.140.0050.00317.53
8.0.130.0030.00314.07
8.0.120.0000.00817.53
8.0.110.0000.00917.43
8.0.100.0060.00317.61
8.0.90.0050.00317.21
8.0.80.0090.01017.45
8.0.70.0030.00517.38
8.0.60.0060.00317.68
8.0.50.0000.00817.32
8.0.30.0130.00617.83
8.0.20.0100.01017.36
8.0.10.0140.00717.59
8.0.00.0070.01317.73
7.4.330.0000.00717.42
7.4.320.0030.00317.10
7.4.300.0040.00416.98
7.4.290.0000.00917.09
7.4.280.0000.00917.15
7.4.270.0040.00416.98
7.4.260.0030.00313.84
7.4.250.0000.00816.93
7.4.240.0030.00417.02
7.4.230.0040.00417.05
7.4.220.0000.00817.02
7.4.210.0050.01317.24
7.4.200.0040.00417.03
7.4.150.0090.00917.11
7.4.140.0100.01016.81
7.4.130.0120.00616.97
7.4.120.0060.01316.88
7.4.110.0100.01017.29
7.4.100.0060.01317.11
7.4.90.0090.01016.81
7.4.80.0110.00717.23
7.4.70.0060.01316.98
7.4.60.0160.00316.91
7.4.50.0160.00316.98
7.4.40.0070.01317.01
7.4.30.0090.00917.24
7.4.20.0100.01017.20
7.4.10.0190.00717.23
7.4.00.0120.01516.97
7.3.330.0040.00416.97
7.3.320.0000.00614.01
7.3.310.0050.00316.93
7.3.300.0000.00716.91
7.3.290.0080.00916.95
7.3.270.0090.00917.01
7.3.260.0120.00916.78
7.3.250.0120.00916.91
7.3.240.0070.01116.95
7.3.230.0060.01316.99
7.3.220.0090.00916.79
7.3.210.0070.01317.00
7.3.200.0110.00716.83
7.3.190.0120.00616.83
7.3.180.0120.00616.79
7.3.170.0160.00317.07
7.3.160.0200.00016.88
7.3.150.0120.00816.86
7.3.140.0160.00916.96
7.3.130.0090.01516.87
7.3.120.0130.01316.93
7.3.110.0090.01717.05
7.3.100.0160.00416.87
7.3.90.0100.00716.95
7.3.80.0070.01116.87
7.3.70.0110.00716.95
7.3.60.0120.00616.90
7.3.50.0060.01216.94
7.3.40.0060.01316.76
7.3.30.0170.00316.89
7.3.20.0030.01817.07
7.3.10.0130.00716.93
7.3.00.0140.01016.81

preferences:
100.18 ms | 403 KiB | 5 Q