3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html=<<<HTML <html> <body> <table id="news" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="539" height="35"><span><strong>Info to Extract</strong></span></td> </tr> <tr> <td height="35" class="texto10">Martes, 02 de Octubre de 2012 | Autor: Trovert</td> </tr> <tr> <td height="35" class="texto12Gris"><p><strong>Info To extract</strong></p> <p><strong>&nbsp;</strong></p> <p><strong>Casa de Gobierno: (a 9 cuadras del hostel)</strong></p> <img title="title" src="../images/theimage.jpg" width="400" height="266" /> </td> </tr> </table> </body> </html> HTML; function walkNode($node) { $str=""; if($node->nodeType==XML_TEXT_NODE) { $str.=$node->nodeValue; } elseif(strtolower($node->nodeName)=="img") { $str.='<img src="'.$node->attributes->getNamedItem("src")->nodeValue.'" />'; } if($node->firstChild) $str.=walkNode($node->firstChild); if($node->nextSibling) $str.=walkNode($node->nextSibling); return $str; } $dom=new DOMDocument(); $dom->loadHTML($html); $xpath=new DOMXPath($dom); $tds=$xpath->query('//table[@id="news"]//tr[position()>0]/td'); foreach($tds as $td) { echo walkNode($td->firstChild); echo "\n"; }

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.0000.01518.93
8.3.50.0110.00622.23
8.3.40.0110.00719.08
8.3.30.0040.01119.34
8.3.20.0080.00020.63
8.3.10.0040.00422.34
8.3.00.0110.00722.70
8.2.180.0160.00316.88
8.2.170.0070.00722.96
8.2.160.0070.00721.31
8.2.150.0180.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00321.58
8.2.110.0030.00621.43
8.2.100.0000.01218.09
8.2.90.0000.00818.25
8.2.80.0040.00419.48
8.2.70.0030.00618.13
8.2.60.0040.00418.00
8.2.50.0080.00018.18
8.2.40.0000.00920.23
8.2.30.0040.00418.52
8.2.20.0000.00818.09
8.2.10.0000.00818.13
8.2.00.0060.00319.73
8.1.280.0110.01125.92
8.1.270.0080.00023.99
8.1.260.0050.00326.35
8.1.250.0140.00028.09
8.1.240.0070.00322.41
8.1.230.0000.01223.13
8.1.220.0050.00318.28
8.1.210.0060.00319.01
8.1.200.0030.00717.72
8.1.190.0070.00317.72
8.1.180.0000.00818.10
8.1.170.0040.00417.72
8.1.160.0040.00422.41
8.1.150.0040.00418.95
8.1.140.0000.00717.80
8.1.130.0030.00618.18
8.1.120.0030.00617.78
8.1.110.0030.00617.87
8.1.100.0070.00017.77
8.1.90.0000.00817.73
8.1.80.0040.00417.91
8.1.70.0030.00317.79
8.1.60.0030.00617.94
8.1.50.0040.00417.72
8.1.40.0040.00417.94
8.1.30.0040.00418.07
8.1.20.0000.00918.04
8.1.10.0000.00817.88
8.1.00.0000.00717.79
8.0.300.0000.00720.40
8.0.290.0070.00017.25
8.0.280.0000.00718.77
8.0.270.0020.00517.72
8.0.260.0000.00817.29
8.0.250.0070.00017.44
8.0.240.0070.00017.43
8.0.230.0000.00717.44
8.0.220.0040.00417.25
8.0.210.0030.00317.39
8.0.200.0040.00417.42
8.0.190.0040.00417.40
8.0.180.0080.00017.28
8.0.170.0000.00817.38
8.0.160.0000.00917.44
8.0.150.0040.00417.27
8.0.140.0040.00417.33
8.0.130.0060.00013.75
8.0.120.0000.00817.36
8.0.110.0000.00817.39
8.0.100.0070.00017.25
8.0.90.0000.00717.31
8.0.80.0090.01217.36
8.0.70.0000.00817.31
8.0.60.0030.00717.35
8.0.50.0070.00017.15
8.0.30.0220.00317.39
8.0.20.0080.01117.63
8.0.10.0050.00217.41
8.0.00.0090.01317.33
7.4.330.0000.00515.00
7.4.320.0000.00617.00
7.4.300.0070.00016.94
7.4.290.0040.00416.89
7.4.280.0000.00717.00
7.4.270.0070.00016.94
7.4.260.0040.00416.83
7.4.250.0040.00416.85
7.4.240.0050.00317.00
7.4.230.0000.00716.71
7.4.220.0130.00717.11
7.4.210.0090.00716.98
7.4.200.0030.00317.05
7.4.190.0030.00616.82
7.4.160.0080.01216.82
7.4.150.0160.00617.40
7.4.140.0070.01317.86
7.4.130.0130.00417.01
7.4.120.0110.01017.03
7.4.110.0100.00716.80
7.4.100.0100.01016.79
7.4.90.0040.01417.02
7.4.80.0180.01519.39
7.4.70.0070.01416.85
7.4.60.0100.01016.79
7.4.50.0030.00317.02
7.4.40.0030.00622.77
7.4.30.0070.01016.98
7.4.00.0090.00915.25
7.3.330.0050.00013.70
7.3.320.0060.00013.69
7.3.310.0070.00016.85
7.3.300.0030.00316.64
7.3.290.0030.01216.80
7.3.280.0070.01116.78
7.3.270.0100.00717.40
7.3.260.0090.00916.92
7.3.250.0090.01216.85
7.3.240.0120.00616.79
7.3.230.0130.00516.81
7.3.210.0110.01116.81
7.3.200.0110.00519.39
7.3.190.0100.00716.84
7.3.180.0080.00817.00
7.3.170.0070.01416.95
7.3.160.0130.00316.90
7.3.120.0040.01114.93
7.3.110.0060.01315.36
7.3.100.0110.00714.98
7.3.90.0070.00314.83
7.3.80.0090.00015.17
7.3.70.0050.00514.82
7.3.60.0070.00714.86
7.3.50.0090.00615.18
7.3.40.0050.00515.02
7.3.30.0060.00915.23
7.3.20.0040.01516.63
7.3.10.0090.00516.77
7.3.00.0090.00416.78
7.2.330.0060.01017.13
7.2.320.0070.01616.90
7.2.310.0090.01316.92
7.2.300.0030.01517.09
7.2.290.0090.00917.15
7.2.250.0030.01315.11
7.2.240.0030.01315.33
7.2.230.0040.01115.30
7.2.220.0060.00615.36
7.2.210.0070.00414.93
7.2.200.0030.01015.13
7.2.190.0030.01215.06
7.2.180.0060.00915.09
7.2.170.0100.00715.22
7.2.130.0030.01317.16
7.2.120.0030.01017.32
7.2.110.0140.00417.10
7.2.100.0090.00617.15
7.2.90.0060.00917.03
7.2.80.0000.01117.41
7.2.70.0040.01116.92
7.2.60.0070.00617.27
7.2.50.0100.00316.81
7.2.40.0030.01016.89
7.2.30.0040.01117.14
7.2.20.0060.01016.72
7.2.10.0070.01016.88
7.2.00.0070.01018.39
7.1.330.0040.01116.08
7.1.320.0040.01116.20
7.1.310.0000.01416.04
7.1.300.0030.01015.88
7.1.290.0100.00015.92
7.1.280.0090.00615.99
7.1.270.0090.00615.99
7.1.260.0100.00615.98
7.1.250.0080.00416.00
7.1.200.0070.00715.75
7.1.100.0000.01118.50
7.1.70.0030.01017.45
7.1.60.0130.01319.82
7.1.50.0120.01217.30
7.1.00.0100.07322.65
7.0.200.0030.00716.64
7.0.140.0100.06722.22
7.0.60.0130.07720.19
7.0.50.0130.06718.08
7.0.40.0000.04720.34
7.0.30.0670.06020.35
7.0.20.0300.08320.51
7.0.10.0370.08020.28
7.0.00.0030.05020.47
5.6.280.0100.06721.24
5.6.210.0130.07020.80
5.6.200.0130.08018.35
5.6.190.0030.04720.63
5.6.180.0400.06320.91
5.6.170.0230.04720.86
5.6.160.0070.05020.63
5.6.150.0030.04718.39
5.6.140.0070.04718.33
5.6.130.0030.05718.40
5.6.120.0100.08321.12
5.6.110.0030.09021.18
5.6.100.0130.06721.18
5.6.90.0100.08021.25
5.6.80.0030.04020.59
5.5.350.0070.05320.58
5.5.340.0170.06718.18
5.5.330.0130.07720.35
5.5.320.0030.04320.38
5.5.310.0330.08020.49
5.5.300.0170.06318.20
5.5.290.0030.06718.26
5.5.280.0100.08020.83
5.5.270.0100.09721.00
5.5.260.0070.04720.96
5.5.250.0100.07720.78
5.5.240.0100.08020.39
5.4.450.0070.06319.63
5.4.440.0200.08319.73
5.4.430.0130.05019.76
5.4.420.0100.06019.62
5.4.410.0100.05319.23
5.4.400.0370.05718.93
5.4.390.0300.06018.96
5.4.380.0230.05318.97
5.4.370.0170.04018.78
5.4.360.0170.04318.65
5.4.350.0080.03512.31
5.4.340.0060.03512.32
5.4.320.0100.03912.80
5.4.310.0060.04812.80
5.4.300.0040.03912.80
5.4.290.0090.04012.79
5.4.280.0050.03812.69
5.4.270.0100.03212.69
5.4.260.0070.07718.93
5.4.250.0000.08319.06
5.4.240.0030.07718.96
5.4.230.0030.05719.14
5.4.220.0230.04318.86
5.4.210.0030.06318.95
5.4.200.0100.07019.16
5.4.190.0130.06319.17
5.4.180.0200.04019.08
5.4.170.0030.05719.14
5.4.160.0070.05718.85
5.4.150.0200.07319.03
5.4.140.0130.05716.60
5.4.130.0130.04316.77
5.4.120.0070.05316.75
5.4.110.0070.05016.70
5.4.100.0100.06716.63
5.4.90.0100.06316.56
5.4.80.0130.05016.80
5.4.70.0070.05016.81
5.4.60.0130.04316.64
5.4.50.0070.04716.45
5.4.40.0100.04716.83
5.4.30.0030.05316.83
5.4.20.0130.07016.60
5.4.10.0170.05316.82
5.4.00.0130.04316.16
5.3.290.0050.04013.04
5.3.280.0130.06014.91
5.3.270.0130.04714.76
5.3.260.0030.05714.95
5.3.250.0070.06014.85
5.3.240.0030.05714.73
5.3.230.0130.06314.84
5.3.220.0130.04714.95
5.3.210.0130.04714.95
5.3.200.0100.07314.75
5.3.190.0000.05714.95
5.3.180.0130.06714.70
5.3.170.0070.06314.71
5.3.160.0170.07014.74
5.3.150.0070.05314.70
5.3.140.0100.05314.81
5.3.130.0200.04714.79
5.3.120.0100.06014.87
5.3.110.0130.05014.89
5.3.100.0100.05014.38
5.3.90.0100.05014.29
5.3.80.0130.04314.26
5.3.70.0100.06014.32
5.3.60.0100.05314.13
5.3.50.0100.05714.15
5.3.40.0000.06014.15
5.3.30.0200.04313.96
5.3.20.0070.07013.99
5.3.10.0070.04713.89
5.3.00.0070.05013.84
5.2.170.0070.06311.30
5.2.160.0070.06011.43
5.2.150.0100.05311.27
5.2.140.0070.04011.38
5.2.130.0170.04711.28
5.2.120.0200.04011.48
5.2.110.0000.04711.23
5.2.100.0130.03011.25
5.2.90.0100.03711.39
5.2.80.0100.03711.26
5.2.70.0030.04311.43
5.2.60.0070.04311.23
5.2.50.0070.04711.20
5.2.40.0070.05711.28
5.2.30.0030.06711.16
5.2.20.0100.05311.04
5.2.10.0070.03711.15
5.2.00.0100.03710.92
5.1.60.0070.03010.17
5.1.50.0170.03710.43
5.1.40.0000.03710.18
5.1.30.0070.03310.52
5.1.20.0070.05310.71
5.1.10.0030.05310.27
5.1.00.0000.05310.27
5.0.50.0130.0308.75
5.0.40.0000.0308.68
5.0.30.0070.0408.42
5.0.20.0000.0408.41
5.0.10.0100.0338.39
5.0.00.0030.0578.34
4.4.90.0070.0176.34
4.4.80.0070.0176.34
4.4.70.0000.0236.34
4.4.60.0000.0236.34
4.4.50.0030.0306.34
4.4.40.0030.0336.34
4.4.30.0000.0236.34
4.4.20.0030.0206.34
4.4.10.0030.0236.34
4.4.00.0030.0336.34
4.3.110.0000.0236.34
4.3.100.0000.0276.34
4.3.90.0070.0176.34
4.3.80.0170.0306.34
4.3.70.0000.0236.34
4.3.60.0000.0276.39
4.3.50.0000.0236.39
4.3.40.0070.0436.39
4.3.30.0030.0306.39
4.3.20.0000.0336.39
4.3.10.0070.0176.39
4.3.00.0070.01713.23

preferences:
50.06 ms | 400 KiB | 5 Q