3v4l.org

run code in 300+ PHP versions simultaneously
<?php //a URL you want to retrieve $my_url = 'http://www.digg.com'; $html = file_get_contents($my_url); $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = new DOMXPath($dom); //Put your XPath Query here $my_xpath_query = "/html/body/div[@id='container']/div[@id='contents']/div[@class='list' and @id='wrapper']/div[@class='main' and position()=1]/div[contains(@class, 'news-summary')]/div[@class='news-body']/h3"; $result_rows = $xpath->query($my_xpath_query); //here we loop through our results (a DOMDocument Object) foreach ($result_rows as $result_object){ echo $result_object->childNodes->item(0)->nodeValue; } ?>

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.00618.27
8.3.50.0150.00716.49
8.3.40.0060.00919.09
8.3.30.0120.00319.07
8.3.20.0100.00020.35
8.3.10.0040.00424.03
8.3.00.0070.00022.90
8.2.180.0120.00617.00
8.2.170.0150.00422.96
8.2.160.0100.00722.44
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0030.00617.74
8.2.110.0080.00417.88
8.2.100.0060.00618.16
8.2.90.0050.00518.00
8.2.80.0080.00019.11
8.2.70.0080.00018.05
8.2.60.0050.00518.16
8.2.50.0000.00818.10
8.2.40.0080.00020.88
8.2.30.0030.00519.86
8.2.20.0040.00417.98
8.2.10.0000.00818.32
8.2.00.0040.00418.27
8.1.270.0080.00020.45
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00723.93
8.1.230.0040.00819.21
8.1.220.0000.00818.04
8.1.210.0000.00818.77
8.1.200.0000.00817.60
8.1.190.0060.00317.50
8.1.180.0030.00618.10
8.1.170.0030.00518.76
8.1.160.0000.00722.42
8.1.150.0000.00818.95
8.1.140.0030.00617.67
8.1.130.0000.00717.83
8.1.120.0050.00217.51
8.1.110.0040.00417.61
8.1.100.0000.00817.63
8.1.90.0030.00517.54
8.1.80.0030.00617.56
8.1.70.0000.00717.61
8.1.60.0080.00417.75
8.1.50.0050.00317.68
8.1.40.0040.00417.66
8.1.30.0030.00517.89
8.1.20.0040.00417.77
8.1.10.0030.00717.62
8.1.00.0000.00817.67
8.0.300.0030.00518.77
8.0.290.0070.00017.13
8.0.280.0040.00418.63
8.0.270.0040.00417.38
8.0.260.0000.00717.39
8.0.250.0040.00417.23
8.0.240.0000.00817.13
8.0.230.0000.00717.18
8.0.220.0040.00417.14
8.0.210.0050.00317.10
8.0.200.0060.00017.20
8.0.190.0030.00617.13
8.0.180.0060.00317.24
8.0.170.0040.00416.96
8.0.160.0050.00317.18
8.0.150.0050.00217.09
8.0.140.0000.00917.15
8.0.130.0030.00313.66
8.0.120.0030.00617.09
8.0.110.0000.00817.08
8.0.100.0040.00417.24
8.0.90.0050.00217.06
8.0.80.0060.00917.25
8.0.70.0050.00217.07
8.0.60.0000.00717.07
8.0.50.0040.00417.19
8.0.30.0070.01217.25
8.0.20.0120.00817.40
8.0.10.0000.00817.14
8.0.00.0080.01216.93
7.4.330.0030.00315.68
7.4.320.0040.00416.87
7.4.300.0030.00316.96
7.4.290.0030.00616.90
7.4.280.0030.00616.88
7.4.270.0070.00016.96
7.4.260.0070.00016.92
7.4.250.0050.00316.91
7.4.240.0040.00417.07
7.4.230.0000.00716.91
7.4.220.0070.01316.97
7.4.210.0100.00917.03
7.4.200.0070.00017.10
7.4.160.0080.00816.97
7.4.150.0180.00017.40
7.4.140.0140.00917.86
7.4.130.0080.01316.90
7.4.120.0110.01017.00
7.4.110.0060.01217.02
7.4.100.0190.00617.03
7.4.90.0100.01016.95
7.4.80.0100.00719.39
7.4.70.0190.00316.98
7.4.60.0130.00316.91
7.4.50.0030.00616.73
7.4.40.0100.00717.09
7.4.30.0150.00917.03
7.4.00.0160.00115.40
7.3.330.0030.00313.51
7.3.320.0050.00013.77
7.3.310.0020.00516.79
7.3.300.0040.00416.79
7.3.290.0040.00416.64
7.3.280.0140.00316.80
7.3.270.0080.01117.40
7.3.260.0100.01016.90
7.3.250.0110.01016.89
7.3.240.0130.01016.76
7.3.230.0100.01516.88
7.3.210.0180.00316.88
7.3.200.0110.00719.39
7.3.190.0030.01417.07
7.3.180.0130.00317.16
7.3.170.0080.01516.75
7.3.160.0120.01116.60
7.3.120.0090.00915.21
7.3.110.0090.01015.07
7.3.100.0060.01015.14
7.3.90.0000.01415.33
7.3.80.0100.00314.95
7.3.70.0080.00814.94
7.3.60.0070.01015.08
7.3.50.0040.00815.10
7.3.40.0070.00315.25
7.3.30.0030.01414.95
7.3.20.0110.00716.94
7.3.10.0070.00517.02
7.3.00.0050.00916.96
7.2.330.0150.00316.99
7.2.320.0060.01317.03
7.2.310.0150.00917.11
7.2.300.0090.00916.90
7.2.290.0080.00816.97
7.2.250.0070.01015.23
7.2.240.0110.01115.33
7.2.230.0030.01315.28
7.2.220.0030.01415.50
7.2.210.0000.01715.16
7.2.200.0000.01515.48
7.2.190.0100.00715.36
7.2.180.0070.00715.31
7.2.170.0060.00715.45
7.2.130.0070.00717.19
7.2.120.0070.00716.87
7.2.110.0060.00617.22
7.2.100.0060.00617.24
7.2.90.0060.00617.07
7.2.80.0050.00817.25
7.2.70.0120.00317.09
7.2.60.0070.00617.27
7.2.50.0080.00617.28
7.2.40.0000.00917.45
7.2.30.0070.00717.00
7.2.20.0040.00817.40
7.2.10.0090.00417.25
7.2.00.0080.00518.59
7.1.330.0090.00616.05
7.1.320.0000.01115.91
7.1.310.0100.00316.11
7.1.300.0030.01016.16
7.1.290.0060.00916.20
7.1.280.0030.01016.23
7.1.270.0070.01016.29
7.1.260.0110.00715.88
7.1.250.0000.01316.19
7.1.200.0040.00816.17
7.1.100.0040.00718.85
7.1.70.0030.00517.31
7.1.60.0130.01320.03
7.1.50.0160.01335.30
7.1.00.0000.07322.69
7.0.200.1220.00615.21
7.0.110.0200.06720.47
7.0.100.0230.07320.59
7.0.90.0130.08020.31
7.0.80.0100.07720.67
7.0.70.0070.05020.58
7.0.60.0100.08020.54
7.0.50.0030.04020.56
7.0.40.0100.07720.16
7.0.30.0170.07320.11
7.0.20.0030.08320.07
7.0.10.0170.06320.08
7.0.00.0100.07020.18
5.6.280.0070.06721.36
5.6.260.0100.04721.19
5.6.250.0070.08321.07
5.6.240.0070.07321.19
5.6.230.0130.07320.98
5.6.220.0170.07321.14
5.6.210.0070.08020.99
5.6.200.0070.07021.25
5.6.190.0070.04021.16
5.6.180.0030.04021.16
5.6.170.0130.05321.00
5.6.160.0070.07720.97
5.6.150.0030.08721.00
5.6.140.0100.07321.00
5.6.130.0000.04321.00
5.6.120.0070.03720.98
5.6.110.0130.07020.98
5.6.100.0100.08721.16
5.6.90.0070.08021.16
5.6.80.0070.08020.66
5.6.70.0100.04020.37
5.6.60.0070.07720.55
5.6.50.0130.08020.39
5.6.40.0030.07720.33
5.6.30.0070.04720.63
5.6.20.0100.07720.35
5.6.10.0130.07320.35
5.6.00.0200.06020.63
5.5.380.0030.08317.97
5.5.370.0070.08018.07
5.5.360.0100.06018.08
5.5.350.0100.07718.07
5.5.340.0070.04018.44
5.5.330.0200.07018.46
5.5.320.0070.08318.35
5.5.310.0100.03318.34
5.5.300.0100.08018.51
5.5.290.0070.08018.39
5.5.280.0000.04318.82
5.5.270.0130.07318.53
5.5.260.0070.06318.39
5.5.250.0100.05718.34
5.5.240.0100.07317.80
5.5.230.0130.07317.88
5.5.220.0070.04317.88
5.5.210.0070.07017.78
5.5.200.0030.07017.86
5.5.190.0030.08017.74
5.5.180.0030.04717.88
5.5.160.0030.07317.70
5.5.150.0070.08017.87
5.5.140.0170.06717.73
5.5.130.0030.07717.70
5.5.120.0070.08317.70
5.5.110.0000.08318.10
5.5.100.0000.08318.01
5.5.90.0030.06317.60
5.5.80.0130.07317.77
5.5.70.0070.08017.68
5.5.60.0070.04717.75
5.5.50.0070.07017.64
5.5.40.0070.07017.63
5.5.30.0000.07718.05
5.5.20.0070.08017.73
5.5.10.0070.07017.77
5.5.00.0200.05717.76
5.4.450.0030.04020.02
5.4.440.0070.05019.74
5.4.430.0100.07020.09
5.4.420.0030.03720.09
5.4.410.0130.04319.89
5.4.400.0030.05019.41
5.4.390.0030.05719.39
5.4.380.0030.07019.50
5.4.370.0000.05019.42
5.4.360.0030.05019.39
5.4.350.0100.04019.61
5.4.340.0070.06019.71
5.4.320.0070.07719.38
5.4.310.0100.07019.78
5.4.300.0130.06319.54
5.4.290.0100.07719.77
5.4.280.0100.07319.65
5.4.270.0030.04719.64
5.4.260.0130.07319.60
5.4.250.0100.04319.40
5.4.240.0100.07319.34
5.4.230.0000.08019.68
5.4.220.0000.08719.52
5.4.210.0130.07019.70
5.4.200.0170.06319.84
5.4.190.0030.07019.83
5.4.180.0200.05019.52
5.4.170.0130.07319.41
5.4.160.0070.07719.32
5.4.150.0030.03719.68
5.4.140.0030.07717.11
5.4.130.0030.04316.90
5.4.120.0100.03016.98
5.4.110.0100.06717.05
5.4.100.0070.07017.02
5.4.90.0130.06317.04
5.4.80.0070.06716.98
5.4.70.0070.06716.99
5.4.60.0130.03016.90
5.4.50.0070.07017.08
5.4.40.0000.04017.02
5.4.30.0000.03716.99
5.4.20.0030.07017.08
5.4.10.0070.06716.90
5.4.00.0000.07016.39

preferences:
56.42 ms | 400 KiB | 5 Q