3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Modified the cURL function to accept POST parameters and a cookiejar file // You will actually need to use a cookie jar because the cookie is not static // Using a cookie jar allows the server to change the cookie as needed and the changed cookie is sent back to the server. function request($url, $params=array(), $cookiejar="") { $ch = curl_init(); $curlOpts = array( CURLOPT_URL => $url, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true ); if (!empty($params)) { // If POST values are given, send that shit too $curlOpts[CURLOPT_POST] = true; $curlOpts[CURLOPT_POSTFIELDS] = $params; } if (!empty($cookiejar)) { if(!file_exists($cookiejar)){ echo 'Cookie file missing. please create it first.'; exit; }else if(!is_writable($cookiejar)){ echo 'Cookie file not writable. chmod it to 777.'; exit; } curl_setopt($ch, CURLOPT_COOKIEJAR, realpath($cookiejar)); curl_setopt($ch, CURLOPT_COOKIEFILE, realpath($cookiejar)); } curl_setopt_array($ch, $curlOpts); $answer = curl_exec($ch); // If there was an error, show it if (curl_error($ch)) die(curl_error($ch)); curl_close($ch); return $answer; } // The url you're trying to access $url = "http://store.steampowered.com/app/223470"; // The url that gives us the cookie $cookie_url = "http://store.steampowered.com/agecheck/app/223470/"; // The POST parameters that are sent to the server when requesting a cookie $params = array("ageDay"=>1, "ageMonth"=>"January", "ageYear"=>"1915", "snr"=>"1_agecheck_agecheck__age-gate"); // This request just give us a cookie. request($cookie_url, $params, "cookiejar"); // And this request is that page you need $html = request($url, array(), "cookiejar"); // Domdoc stuff that we already discussed $dom = new domDocument; libxml_use_internal_errors(true); $dom->loadHTML($html); $classname="game_description_snippet"; $finder = new DomXPath($dom); $spaner = $finder->query("//*[contains(@class, '$classname')]"); foreach ($spaner as $spane) { $mo = $spane->nodeValue; echo $mo; }

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.70.0110.00416.63
8.3.60.0150.00616.87
8.3.50.0150.00521.16
8.3.40.0060.01318.78
8.3.30.0100.01018.79
8.3.20.0140.00320.34
8.3.10.0100.01021.80
8.3.00.0150.00423.66
8.2.190.0070.01416.88
8.2.180.0070.01417.00
8.2.170.0180.00322.96
8.2.160.0140.00420.35
8.2.150.0110.00724.18
8.2.140.0160.00324.66
8.2.130.0110.00720.85
8.2.120.0070.01126.35
8.2.110.0160.00321.13
8.2.100.0080.00417.92
8.2.90.0050.00319.05
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0000.00817.93
8.2.50.0040.00718.09
8.2.40.0040.00422.21
8.2.30.0040.00419.53
8.2.20.0000.00817.73
8.2.10.0080.00017.98
8.2.00.0040.00418.11
8.1.280.0160.00625.92
8.1.270.0120.00622.07
8.1.260.0140.00328.09
8.1.250.0130.00728.09
8.1.240.0090.00019.01
8.1.230.0110.00017.64
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0030.00617.23
8.1.190.0030.00517.25
8.1.180.0040.00418.10
8.1.170.0080.00018.47
8.1.160.0040.00420.68
8.1.150.0040.00418.81
8.1.140.0050.00319.56
8.1.130.0030.00317.68
8.1.120.0040.00817.35
8.1.110.0070.00017.50
8.1.100.0080.00017.47
8.1.90.0030.00517.50
8.1.80.0080.00017.34
8.1.70.0000.00717.43
8.1.60.0000.00817.56
8.1.50.0090.00017.56
8.1.40.0070.00317.55
8.1.30.0030.00617.65
8.1.20.0000.00817.52
8.1.10.0020.00517.52
8.1.00.0040.00417.59
8.0.300.0050.00318.77
8.0.290.0050.00316.75
8.0.280.0000.00718.44
8.0.270.0040.00416.96
8.0.260.0030.00317.17
8.0.250.0030.00517.07
8.0.240.0050.00217.02
8.0.230.0000.00716.97
8.0.220.0040.00416.90
8.0.210.0040.00416.83
8.0.200.0070.00416.88
8.0.190.0040.00417.00
8.0.180.0000.00717.00
8.0.170.0000.00817.00
8.0.160.0000.00816.93
8.0.150.0000.00716.96
8.0.140.0000.00716.85
8.0.130.0030.00313.35
8.0.120.0040.00416.91
8.0.110.0000.00816.91
8.0.100.0000.00716.74
8.0.90.0040.00416.82
8.0.80.0000.01516.92
8.0.70.0000.00716.91
8.0.60.0050.00316.88
8.0.50.0030.00616.95
8.0.30.0090.01017.35
8.0.20.0150.00717.40
8.0.10.0040.00417.10
8.0.00.0080.00916.66
7.4.330.0020.00216.78
7.4.320.0030.00316.64
7.4.300.0080.00016.56
7.4.290.0000.00716.70
7.4.280.0030.00316.64
7.4.270.0040.00416.53
7.4.260.0000.00716.67
7.4.250.0080.00016.60
7.4.240.0000.00716.58
7.4.230.0000.00716.72
7.4.220.0160.01016.60
7.4.210.0120.00916.67
7.4.200.0040.00416.44
7.4.160.0090.00616.51
7.4.150.0040.01417.40
7.4.140.0120.00917.86
7.4.130.0040.01516.59
7.4.120.0110.00916.47
7.4.110.0030.01416.43
7.4.100.0090.01616.63
7.4.90.0130.00816.41
7.4.80.0150.00319.39
7.4.70.0080.01216.76
7.4.60.0120.00616.62
7.4.50.0000.01216.27
7.4.40.0040.01216.61
7.4.30.0110.00716.61
7.4.10.0130.00614.74
7.4.00.0040.01015.20
7.3.330.0030.00313.41
7.3.320.0000.00613.36
7.3.310.0000.00716.17
7.3.300.0030.00316.36
7.3.290.0070.00016.22
7.3.280.0060.01216.34
7.3.270.0070.01017.40
7.3.260.0120.00616.62
7.3.250.0100.00816.33
7.3.240.0100.00916.41
7.3.230.0110.00516.66
7.3.210.0100.01016.39
7.3.200.0090.01219.39
7.3.190.0110.00616.64
7.3.180.0120.00616.49
7.3.170.0060.01016.52
7.3.160.0090.01216.46
7.3.130.0070.01014.60
7.3.120.0100.01014.79
7.3.110.0040.00815.01
7.3.100.0000.01214.64
7.3.90.0060.00315.09
7.3.80.0070.00414.69
7.3.70.0100.00014.77
7.3.60.0080.00414.68
7.3.50.0090.00614.51
7.3.40.0060.00914.88
7.3.30.0000.00914.66
7.3.20.0120.00616.37
7.3.10.0060.00816.51
7.3.00.0100.00316.61
7.2.330.0110.00716.57
7.2.320.0100.01316.64
7.2.310.0050.01616.32
7.2.300.0070.01116.65
7.2.290.0100.00616.43
7.2.260.0070.01114.95
7.2.250.0100.01014.84
7.2.240.0090.00614.90
7.2.230.0120.00614.95
7.2.220.0070.00714.98
7.2.210.0030.00614.85
7.2.200.0030.01114.93
7.2.190.0030.01014.98
7.2.180.0030.00615.07
7.2.170.0030.01215.05
7.2.160.0000.01815.06
7.2.150.0040.01416.77
7.2.140.0140.00016.84
7.2.130.0050.00816.59
7.2.120.0050.00716.80
7.2.110.0020.01216.63
7.2.100.0030.01116.68
7.2.90.0080.00516.81
7.2.80.0050.00816.88
7.2.70.0060.00816.77
7.2.60.0080.00716.71
7.2.50.0050.00816.70
7.2.40.0030.01116.63
7.2.30.0090.00316.67
7.2.20.0030.01016.68
7.2.10.0060.00616.81
7.2.00.0090.00717.69
7.1.330.0000.01515.73
7.1.320.0060.00615.65
7.1.310.0030.01015.67
7.1.300.0030.01015.73
7.1.290.0040.00715.68
7.1.280.0030.01015.64
7.1.270.0000.00915.52
7.1.260.0000.00915.79
7.1.250.0050.00915.61
7.1.240.0030.00615.74
7.1.230.0000.01215.37
7.1.220.0080.00715.58
7.1.210.0000.01115.56
7.1.200.0050.00615.60
7.1.190.0030.00915.64
7.1.180.0030.00915.50
7.1.170.0030.01015.73
7.1.160.0040.01115.64
7.1.150.0060.00315.83
7.1.140.0000.01015.68
7.1.130.0060.00315.40
7.1.120.0120.00315.83
7.1.110.0040.01415.77
7.1.100.0070.00516.93
7.1.90.0060.00615.66
7.1.80.0070.00415.81
7.1.70.0030.00616.29
7.1.60.0090.00817.40
7.1.50.0050.00916.21
7.1.40.0030.00915.78
7.1.30.0060.00915.77
7.1.20.0090.00615.74
7.1.10.0070.00315.75
7.1.00.0060.04019.04
7.0.330.0030.00715.14
7.0.320.0100.00615.31
7.0.310.0070.00315.44
7.0.300.0100.00015.45
7.0.290.0030.00715.55
7.0.280.0000.01315.44
7.0.270.0070.00415.16
7.0.260.0060.00915.43
7.0.250.0000.01015.35
7.0.240.0000.01015.38
7.0.230.0110.00415.34
7.0.220.0030.00615.42
7.0.210.0030.00715.08
7.0.200.0230.00115.12
7.0.190.0040.00415.38
7.0.180.0030.01015.34
7.0.170.0040.00815.30
7.0.160.0070.01015.26
7.0.150.0030.00615.30
7.0.140.0070.00715.49
7.0.130.0060.00615.38
7.0.120.0030.01015.55
7.0.110.0000.01315.11
7.0.100.0090.00315.28
7.0.90.0130.00015.20
7.0.80.0080.00315.43
7.0.70.0030.01015.19
7.0.60.0110.04318.44
7.0.50.0080.04216.79
7.0.40.0070.04417.08
7.0.30.0280.03517.09
7.0.20.0190.03817.16
7.0.10.0080.04117.08
7.0.00.0050.04517.15
5.6.400.0060.00914.55
5.6.390.0030.00614.29
5.6.380.0030.01114.47
5.6.370.0030.01214.17
5.6.360.0090.00614.22
5.6.350.0000.01314.13
5.6.340.0070.00714.06
5.6.330.0070.01014.33
5.6.320.0030.00614.25
5.6.310.0090.00614.11
5.6.300.0040.01114.30
5.6.290.0040.01114.38
5.6.280.0060.01917.53
5.6.270.0070.00714.31
5.6.260.0030.01314.06
5.6.250.0090.00614.31
5.6.240.0030.01314.39
5.6.230.0030.01614.31
5.6.220.0090.00614.19
5.6.210.0050.02517.45
5.6.200.0050.03916.25
5.6.190.0100.04617.38
5.6.180.0200.03517.31
5.6.170.0230.03317.28
5.6.160.0070.04417.31
5.6.150.0130.01916.13
5.6.140.0050.02116.17
5.6.130.0030.02516.30
5.6.120.0070.04517.53
5.6.110.0050.02317.68
5.6.100.0050.04417.61
5.6.90.0050.04517.71
5.6.80.0030.03017.23
5.6.70.0040.00414.09
5.6.60.0030.01014.28
5.6.50.0080.00814.06
5.6.40.0070.00714.06
5.6.30.0040.01114.22
5.6.20.0090.00914.06
5.6.10.0070.00414.06
5.6.00.0040.00814.06
5.5.380.0100.00714.30
5.5.370.0000.01214.06
5.5.360.0070.00714.24
5.5.350.0000.02917.26
5.5.340.0090.03216.02
5.5.330.0050.04517.41
5.5.320.0290.03917.17
5.5.310.0120.02217.16
5.5.300.0150.01616.11
5.5.290.0110.03016.13
5.5.280.0090.04317.48
5.5.270.0070.02017.52
5.5.260.0060.05017.42
5.5.250.0110.03817.40
5.5.240.0190.02517.22
5.5.230.0060.00614.21
5.5.220.0080.00414.22
5.5.210.0000.01014.36
5.5.200.0030.01014.06
5.5.190.0060.01014.14
5.5.180.0000.01114.20
5.5.170.0040.00814.06
5.5.160.0030.01014.07
5.5.150.0130.00014.16
5.5.140.0100.00014.06
5.5.130.0030.01014.21
5.5.120.0040.00814.06
5.5.110.0040.00414.06
5.5.100.0060.00314.34
5.5.90.0050.00314.20
5.5.80.0000.01014.16
5.5.70.0070.00714.06
5.5.60.0000.01214.16
5.5.50.0080.00414.14
5.5.40.0040.01114.06
5.5.30.0070.00714.06
5.5.20.0030.01214.32
5.5.10.0060.00614.20
5.5.00.0090.00614.06

preferences:
85 ms | 401 KiB | 5 Q