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.0150.00418.56
8.3.50.0140.00716.63
8.3.40.0120.00319.04
8.3.30.0070.01119.09
8.3.20.0070.00320.59
8.3.10.0040.00423.77
8.3.00.0050.00322.68
8.2.180.0000.01416.75
8.2.170.0040.01222.96
8.2.160.0070.01120.44
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0060.00317.75
8.2.110.0090.00019.59
8.2.100.0060.00617.75
8.2.90.0030.00619.34
8.2.80.0040.00417.97
8.2.70.0030.00617.88
8.2.60.0040.00418.16
8.2.50.0000.00918.07
8.2.40.0080.00021.21
8.2.30.0040.00419.87
8.2.20.0040.00417.96
8.2.10.0060.00318.34
8.2.00.0080.00018.18
8.1.280.0120.00325.92
8.1.270.0000.00820.54
8.1.260.0080.00426.35
8.1.250.0030.00628.09
8.1.240.0060.00324.05
8.1.230.0110.00020.97
8.1.220.0030.00617.78
8.1.210.0040.00418.77
8.1.200.0060.00617.60
8.1.190.0030.00517.60
8.1.180.0040.00418.10
8.1.170.0000.00818.61
8.1.160.0030.00522.07
8.1.150.0040.00418.91
8.1.140.0000.00817.64
8.1.130.0040.00317.91
8.1.120.0040.00417.46
8.1.110.0040.00417.44
8.1.100.0000.00817.49
8.1.90.0040.00417.55
8.1.80.0100.00017.55
8.1.70.0000.00717.53
8.1.60.0080.00017.64
8.1.50.0000.00817.78
8.1.40.0060.00317.58
8.1.30.0040.00417.79
8.1.20.0040.00417.84
8.1.10.0100.00317.74
8.1.00.0050.00317.67
8.0.300.0040.00418.77
8.0.290.0000.00917.00
8.0.280.0040.00418.52
8.0.270.0000.00717.58
8.0.260.0070.00017.33
8.0.250.0040.00417.11
8.0.240.0050.00317.09
8.0.230.0000.00717.16
8.0.220.0030.00317.14
8.0.210.0040.00417.12
8.0.200.0030.00317.15
8.0.190.0080.00017.22
8.0.180.0040.00417.16
8.0.170.0000.00817.13
8.0.160.0070.00017.20
8.0.150.0040.00416.97
8.0.140.0000.00817.09
8.0.130.0060.00013.69
8.0.120.0060.00317.10
8.0.110.0040.00417.20
8.0.100.0000.00817.10
8.0.90.0050.00317.10
8.0.80.0070.01017.25
8.0.70.0050.00317.09
8.0.60.0040.00417.25
8.0.50.0000.00817.20
8.0.30.0130.00517.40
8.0.20.0110.00917.40
8.0.10.0000.00917.26
8.0.00.0100.01116.95
7.4.330.0050.00015.70
7.4.320.0000.00716.95
7.4.300.0030.00316.91
7.4.290.0000.00816.95
7.4.280.0070.00016.98
7.4.270.0070.00017.05
7.4.260.0030.00616.95
7.4.250.0080.00016.98
7.4.240.0050.00316.98
7.4.230.0080.00016.93
7.4.220.0060.01017.01
7.4.210.0110.00617.11
7.4.200.0040.00416.77
7.4.160.0120.00417.18
7.4.150.0070.01017.40
7.4.140.0120.01217.86
7.4.130.0110.00816.91
7.4.120.0100.01116.99
7.4.110.0090.01316.84
7.4.100.0060.01517.01
7.4.90.0140.00316.95
7.4.80.0090.00919.39
7.4.70.0140.00316.94
7.4.60.0150.00316.97
7.4.50.0030.00316.73
7.4.40.0140.00416.99
7.4.30.0140.01016.98
7.4.00.0180.00015.04
7.3.330.0030.00313.58
7.3.320.0050.00013.78
7.3.310.0070.00016.65
7.3.300.0040.00416.76
7.3.290.0070.00016.84
7.3.280.0080.01316.82
7.3.270.0060.01217.40
7.3.260.0110.01116.73
7.3.250.0110.01016.85
7.3.240.0130.00616.75
7.3.230.0060.01416.76
7.3.210.0090.00916.88
7.3.200.0080.00819.39
7.3.190.0150.00416.71
7.3.180.0050.01116.88
7.3.170.0120.01116.79
7.3.160.0060.01216.68
7.3.10.0110.00016.55
7.3.00.0060.00616.74
7.2.330.0040.01417.15
7.2.320.0100.00716.97
7.2.310.0060.01017.20
7.2.300.0090.01217.02
7.2.290.0060.01316.83
7.2.130.0070.00716.70
7.2.120.0070.01016.87
7.2.110.0070.01017.02
7.2.100.0040.01416.85
7.2.90.0000.00917.20
7.2.80.0080.00416.90
7.2.70.0060.00616.95
7.2.60.0060.00817.08
7.2.50.0030.01017.15
7.2.40.0060.00617.27
7.2.30.0160.00017.10
7.2.20.0120.00416.96
7.2.10.0070.00317.20
7.2.00.0050.00918.55
7.1.250.0000.00815.78
7.1.200.0030.01016.01
7.1.100.0070.00718.51
7.1.70.0030.00717.62
7.1.60.0180.00620.03
7.1.50.0270.01035.06
7.1.00.0030.07722.81
7.0.200.0410.00614.98
7.0.60.0130.08020.55
7.0.50.0100.05018.31
7.0.40.0070.06720.59
7.0.30.0530.07720.63
7.0.20.0230.05020.71
7.0.10.0070.04720.70
7.0.00.0030.05720.48
5.6.280.0070.06321.49
5.6.210.0130.07721.00
5.6.200.0030.04018.57
5.6.190.0100.06321.06
5.6.180.0470.07721.09
5.6.170.0300.07021.09
5.6.160.0030.08020.97
5.6.150.0070.08018.75
5.6.140.0070.08018.68
5.6.130.0000.04318.65
5.6.120.0100.07721.59
5.6.110.0070.09021.48
5.6.100.0100.07721.61
5.6.90.0100.05721.46
5.6.80.0070.05320.98
5.6.70.4100.04320.97
5.5.350.0100.08320.79
5.5.340.0030.05318.42
5.5.330.0100.04720.89
5.5.320.0370.07320.82
5.5.310.0330.06320.81
5.5.300.0100.04718.44
5.5.290.0130.03018.51
5.5.280.0030.09021.05
5.5.270.0100.09021.37
5.5.260.0070.04021.20
5.5.250.0130.08020.99
5.5.240.0200.07320.73
5.4.450.0530.06319.79
5.4.440.0270.06019.82
5.4.430.0200.05320.00
5.4.420.0300.05320.00
5.4.410.0630.05719.72
5.4.400.0670.05019.59
5.4.390.0730.05019.52
5.4.380.0730.04319.52
5.4.370.0670.05019.71
5.4.360.0600.05319.34
5.4.350.0100.05719.68
5.4.340.0530.06719.58
5.4.320.0600.06019.56
5.4.310.0670.05019.49
5.4.300.0670.05719.66
5.4.290.0730.04719.52
5.4.280.0770.04719.67
5.4.270.0770.04719.68
5.4.260.0800.04719.49
5.4.250.0470.05719.67
5.4.240.0130.05319.48
5.4.230.0300.04719.64
5.4.220.0330.05319.66
5.4.210.0300.04719.42
5.4.200.0130.05017.11
5.4.190.0170.05719.46
5.4.180.0230.07019.52
5.4.170.0200.05719.37
5.4.160.0200.05019.46
5.4.150.0200.05019.40
5.4.140.0330.04716.95
5.4.130.0130.05316.93
5.4.120.0270.04717.07
5.4.110.0200.04716.75
5.4.100.0100.05716.80
5.4.90.0170.05016.96
5.4.80.0170.06016.86
5.4.70.0070.06316.72
5.4.60.0230.04716.97
5.4.50.0070.05017.01
5.4.40.0230.05317.16
5.4.30.0200.03017.16
5.4.20.0330.06316.95

preferences:
39.69 ms | 400 KiB | 5 Q