3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRemoteFile($url) { // get the host name and url path $parsedUrl = parse_url($url); $host = $parsedUrl['host']; if (isset($parsedUrl['path'])) { $path = $parsedUrl['path']; } else { // the url is pointing to the host like http://www.mysite.com $path = '/'; } if (isset($parsedUrl['query'])) { $path .= '?' . $parsedUrl['query']; } if (isset($parsedUrl['port'])) { $port = $parsedUrl['port']; } else { // most sites use port 80 $port = '80'; } $timeout = 10; $response = ''; // connect to the remote server $fp = @fsockopen($host, '80', $errno, $errstr, $timeout ); if( !$fp ) { echo "Cannot retrieve $url"; } else { // send the necessary headers to get the file fputs($fp, "GET $path HTTP/1.0\r\n" . "Host: $host\r\n" . "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3\r\n" . "Accept: */*\r\n" . "Accept-Language: en-us,en;q=0.5\r\n" . "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n" . "Keep-Alive: 300\r\n" . "Connection: keep-alive\r\n" . "Referer: http://$host\r\n\r\n"); // retrieve the response from the remote server while ( $line = fread( $fp, 4096 ) ) { $response .= $line; } fclose( $fp ); // strip the headers $pos = strpos($response, "\r\n\r\n"); $response = substr($response, $pos + 4); } // return the file content return $response; } $content = getRemoteFile('http://www.gammebaie.com/feed?post_type=actualites'); var_dump($content);

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.00318.84
8.3.50.0150.00618.43
8.3.40.0120.00319.12
8.3.30.0110.00419.50
8.3.20.0050.00320.54
8.3.10.0080.00022.04
8.3.00.0040.00419.76
8.2.180.0070.01416.88
8.2.170.0110.00422.96
8.2.160.0060.01320.65
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0030.00519.73
8.2.110.0030.00720.72
8.2.100.0110.00017.97
8.2.90.0000.00819.46
8.2.80.0000.00817.97
8.2.70.0000.01217.88
8.2.60.0030.00518.17
8.2.50.0050.00318.07
8.2.40.0040.00420.26
8.2.30.0030.00618.31
8.2.20.0050.00218.04
8.2.10.0080.00018.37
8.2.00.0000.00817.89
8.1.280.0150.00625.92
8.1.270.0130.00720.71
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00924.03
8.1.230.0120.00021.30
8.1.220.0040.00418.03
8.1.210.0000.00918.77
8.1.200.0030.00717.60
8.1.190.0060.00317.48
8.1.180.0040.00418.10
8.1.170.0060.00320.44
8.1.160.0040.00422.30
8.1.150.0000.00719.05
8.1.140.0040.00417.70
8.1.130.0000.00718.05
8.1.120.0000.01017.76
8.1.110.0040.00417.54
8.1.100.0040.00417.74
8.1.90.0030.00517.61
8.1.80.0070.00017.55
8.1.70.0000.00717.65
8.1.60.0000.00817.86
8.1.50.0000.01017.59
8.1.40.0030.00517.64
8.1.30.0060.00317.96
8.1.20.0050.00317.77
8.1.10.0030.00917.71
8.1.00.0090.00017.71
8.0.300.0040.00418.77
8.0.290.0040.00417.00
8.0.280.0030.00518.69
8.0.270.0070.00017.55
8.0.260.0070.00017.38
8.0.250.0000.00717.18
8.0.240.0000.00717.19
8.0.230.0000.00717.22
8.0.220.0050.00217.17
8.0.210.0000.00817.10
8.0.200.0080.00017.21
8.0.190.0030.00517.19
8.0.180.0070.00017.22
8.0.170.0070.00017.11
8.0.160.0000.00717.08
8.0.150.0050.00217.14
8.0.140.0000.00817.07
8.0.130.0000.00913.66
8.0.120.0000.00817.19
8.0.110.0000.00817.20
8.0.100.0030.00617.29
8.0.90.0080.00017.18
8.0.80.0070.01417.24
8.0.70.0060.00317.14
8.0.60.0040.00417.18
8.0.50.0080.00017.24
8.0.30.0130.01217.52
8.0.20.0170.00517.47
8.0.10.0070.00017.29
8.0.00.0060.01117.05
7.4.330.0030.00315.47
7.4.320.0030.00316.61
7.4.300.0070.00016.74
7.4.290.0030.00316.73
7.4.280.0000.00816.80
7.4.270.0030.00316.77
7.4.260.0030.00316.73
7.4.250.0080.00016.79
7.4.240.0030.00516.76
7.4.230.0050.00316.89
7.4.220.0130.00616.85
7.4.210.0070.01416.84
7.4.200.0000.00716.80
7.4.160.0130.00316.86
7.4.150.0100.01117.40
7.4.140.0130.01117.86
7.4.130.0110.00916.85
7.4.120.0100.01116.82
7.4.110.0090.00916.70
7.4.100.0140.01016.86
7.4.90.0100.01016.87
7.4.80.0090.00919.39
7.4.70.0120.00616.88
7.4.60.0090.00616.70
7.4.50.0060.00316.66
7.4.40.0070.01116.83
7.4.30.0120.00616.73
7.4.10.0100.01015.34
7.4.00.0090.00815.43
7.3.330.0060.00013.53
7.3.320.0100.00313.45
7.3.310.0050.00216.60
7.3.300.0080.00016.60
7.3.290.0080.00716.65
7.3.280.0070.00916.63
7.3.270.0120.00617.40
7.3.260.0170.00316.84
7.3.250.0130.00616.83
7.3.240.0110.00816.68
7.3.230.0090.01416.65
7.3.210.0100.00816.79
7.3.200.0140.00419.39
7.3.190.0120.00616.80
7.3.180.0070.01016.85
7.3.170.0080.01116.73
7.3.160.0130.01016.82
7.3.130.0110.00314.81
7.3.120.0040.01115.08
7.3.110.0030.01015.29
7.3.100.0060.00615.24
7.3.90.0000.01814.75
7.3.80.0120.00315.09
7.3.70.0030.00615.19
7.3.60.0110.00415.20
7.3.50.0030.00615.16
7.3.40.0000.01115.18
7.3.30.0070.01115.20
7.3.20.0060.00616.85
7.3.10.0030.01016.97
7.3.00.0050.01016.92
7.2.330.0080.01116.97
7.2.320.0110.00717.01
7.2.310.0090.01217.09
7.2.300.0120.01217.06
7.2.290.0060.01816.95
7.2.260.0030.01615.33
7.2.250.0070.01315.31
7.2.240.0040.01515.31
7.2.230.0100.00714.90
7.2.220.0000.01114.96
7.2.210.0090.00614.84
7.2.200.0000.01015.28
7.2.190.0030.01015.32
7.2.180.0060.00315.30
7.2.170.0000.01415.43
7.2.160.0090.00915.28
7.2.150.0030.01017.22
7.2.140.0030.01317.11
7.2.130.0110.00617.19
7.2.120.0050.00817.13
7.2.110.0060.00617.05
7.2.100.0060.00617.27
7.2.90.0030.00817.08
7.2.80.0070.00517.27
7.2.70.0110.00517.07
7.2.60.0070.00817.10
7.2.50.0040.01117.18
7.2.40.0020.01217.04
7.2.30.0060.00717.17
7.2.20.0050.01117.08
7.2.10.0110.00516.95
7.2.00.0050.00617.94
7.1.330.0040.01115.86
7.1.320.0170.00016.21
7.1.310.0040.01116.21
7.1.300.0080.00416.01
7.1.290.0060.00916.06
7.1.280.0060.01016.10
7.1.270.0000.00915.95
7.1.260.0070.00716.01
7.1.250.0070.00615.89
7.1.240.0000.01016.04
7.1.230.0030.00915.70
7.1.220.0140.00016.11
7.1.210.0090.00016.08
7.1.200.0060.00616.09
7.1.190.0030.00616.18
7.1.180.0000.01315.78
7.1.170.0030.01016.11
7.1.160.0040.00415.82
7.1.150.0070.01015.98
7.1.140.0030.01315.93
7.1.130.0070.00416.08
7.1.120.0000.01215.72
7.1.110.0080.00416.11
7.1.100.0090.00917.30
7.1.90.0120.00015.96
7.1.80.0060.00615.96
7.1.70.0030.00816.87
7.1.60.0080.01117.79
7.1.50.0060.01316.59
7.1.40.0040.01116.18
7.1.30.0030.01016.10
7.1.20.0070.00716.00
7.1.10.0040.00716.06
7.1.00.0050.04219.49
7.0.330.0040.01215.60
7.0.320.0000.01015.59
7.0.310.0070.00715.80
7.0.300.0070.00715.57
7.0.290.0030.00715.65
7.0.280.0060.00615.64
7.0.270.0060.00615.73
7.0.260.0040.01015.53
7.0.250.0100.00715.71
7.0.240.0000.01215.78
7.0.230.0040.01215.43
7.0.220.0040.00815.43
7.0.210.0080.00415.64
7.0.200.0030.00915.47
7.0.190.0060.01015.81
7.0.180.0060.00915.76
7.0.170.0000.01415.80
7.0.160.0090.00315.67
7.0.150.0000.01415.52
7.0.140.0020.04119.02
7.0.130.0150.00015.60
7.0.120.0110.00015.73
7.0.110.0060.00615.50
7.0.100.0070.00715.71
7.0.90.0090.00615.70
7.0.80.0060.00615.57
7.0.70.0070.00715.71
7.0.60.0140.03218.07
7.0.50.0050.03516.85
7.0.40.0140.04117.03
7.0.30.0200.04517.15
7.0.20.0150.04417.13
7.0.10.0180.02717.13
7.0.00.0080.02317.03
5.6.400.0060.00914.78
5.6.390.0090.00614.95
5.6.380.0030.01014.59
5.6.370.0090.00614.90
5.6.360.0100.00314.68
5.6.350.0120.00314.67
5.6.340.0000.01814.82
5.6.330.0050.00514.70
5.6.320.0090.00614.59
5.6.310.0110.00414.62
5.6.300.0100.00314.66
5.6.290.0070.00714.98
5.6.280.0050.04017.85
5.6.270.0080.00815.09
5.6.260.0000.01114.70
5.6.250.0030.00914.68
5.6.240.0050.00414.89
5.6.230.0040.00414.94
5.6.220.0070.00314.78
5.6.210.0100.02217.93
5.6.200.0030.03016.58
5.6.190.0050.04417.89
5.6.180.0260.04017.96
5.6.170.0150.04217.78
5.6.160.0090.04417.71
5.6.150.0080.04316.74
5.6.140.0030.02816.54
5.6.130.0100.04016.39
5.6.120.0050.03117.99
5.6.110.0100.04317.99
5.6.100.0030.02618.08
5.6.90.0030.02817.96
5.6.80.0080.03817.73
5.6.70.0000.01014.41
5.6.60.0070.01014.36
5.6.50.0030.01014.66
5.6.40.0000.01614.46
5.6.30.0070.01014.47
5.6.20.0070.01014.41
5.6.10.0030.01314.61
5.6.00.0130.00314.55
5.5.380.0070.01014.62
5.5.370.0030.01014.36
5.5.360.0060.00614.34
5.5.350.0150.04117.89
5.5.340.0030.02516.69
5.5.330.0060.04017.67
5.5.320.0130.02817.68
5.5.310.0210.04417.78
5.5.300.0050.02416.28
5.5.290.0120.04016.52
5.5.280.0070.02118.04
5.5.270.0030.03217.80
5.5.260.0070.04618.13
5.5.250.0070.03817.85
5.5.240.0030.03117.56
5.5.230.0000.01714.73
5.5.220.0100.00614.41
5.5.210.0060.01014.55
5.5.200.0040.00714.50
5.5.190.0030.01414.53
5.5.180.0090.00614.77
5.5.170.0000.01214.39
5.5.160.0060.00614.55
5.5.150.0090.00614.78
5.5.140.0130.00314.59
5.5.130.0000.01714.59
5.5.120.0060.00914.75
5.5.110.0060.00914.11
5.5.100.0100.00714.68
5.5.90.0000.01814.68
5.5.80.0000.01414.43
5.5.70.0100.00014.79
5.5.60.0000.01214.08
5.5.50.0040.01114.11
5.5.40.0070.00714.59
5.5.30.0060.00314.82
5.5.20.0030.00714.74
5.5.10.0060.00614.67
5.5.00.0080.00414.68
5.4.450.0390.03715.69
5.4.440.0470.03015.83
5.4.430.0520.03515.75
5.4.420.0430.02515.84
5.4.410.0090.03015.56
5.4.400.0620.04015.42
5.4.390.0620.03715.43
5.4.380.0630.03815.49
5.4.370.0580.04415.28
5.4.360.0730.03615.44
5.4.350.0620.04415.28
5.4.340.0600.04215.49
5.4.330.0040.00711.83
5.4.320.0620.05015.42
5.4.310.0800.03515.28
5.4.300.0620.03915.30
5.4.290.0560.04115.42
5.4.280.0610.02315.48
5.4.270.0420.03515.28
5.4.260.0510.03415.28
5.4.250.0450.03315.26
5.4.240.0550.03615.35
5.4.230.0580.03815.49
5.4.220.0520.03715.33
5.4.210.0490.04115.46
5.4.200.0480.03014.32
5.4.190.0560.03115.41
5.4.180.0420.03515.46
5.4.170.0530.03015.41
5.4.160.0620.03215.32
5.4.150.0500.03515.32
5.4.140.0510.03014.24
5.4.130.0490.02514.19
5.4.120.0580.03314.17
5.4.110.0600.02914.17
5.4.100.0470.03714.14
5.4.90.0650.03714.19
5.4.80.0720.04414.12
5.4.70.0620.04214.23
5.4.60.0560.03514.15
5.4.50.0540.03914.18
5.4.40.0630.03014.20
5.4.30.0600.03514.21
5.4.20.0630.04314.23
5.4.10.0600.03014.13
5.4.00.0730.03513.92
5.3.290.1070.05314.80
5.3.280.1330.07014.87
5.3.270.1030.08714.88
5.3.260.1400.07014.71
5.3.250.1300.07314.88
5.3.240.1070.05014.93
5.3.230.0970.05314.79
5.3.220.1230.06014.79
5.3.210.1000.05014.81
5.3.200.0870.05014.84
5.3.190.0900.06314.84
5.3.180.1000.06314.83
5.3.170.1000.05714.81
5.3.160.1200.06314.81
5.3.150.1400.06714.81
5.3.140.1670.06014.68
5.3.130.1670.05714.69
5.3.120.1630.06014.69
5.3.110.1700.07314.70
5.3.100.1370.07014.30
5.3.90.1530.06714.25
5.3.80.1630.06714.12
5.3.70.1530.05714.34
5.3.60.1230.07014.30
5.3.50.1200.06314.07
5.3.40.1600.05714.19
5.3.30.1400.06714.02
5.3.20.1330.06313.81
5.3.10.1230.07013.90
5.3.00.1400.04313.88
5.2.170.0930.05311.44
5.2.160.1100.05711.39
5.2.150.1070.05311.23
5.2.140.1070.04311.34
5.2.130.0770.05011.31
5.2.120.1000.04711.26
5.2.110.1070.05011.31
5.2.100.1100.05311.33
5.2.90.1100.05011.39
5.2.80.0930.06711.30
5.2.70.0930.06011.25
5.2.60.0970.05311.29
5.2.50.1100.05011.24
5.2.40.1000.05711.20
5.2.30.0830.04711.20
5.2.20.0570.05311.11
5.2.10.0330.04311.16
5.2.00.0270.04710.88
5.1.60.0930.02710.26
5.1.50.0970.04310.10
5.1.40.0870.03310.12
5.1.30.0830.03710.60
5.1.20.0800.05010.48
5.1.10.0800.04710.34
5.1.00.0870.05010.32
5.0.50.0630.0308.87
5.0.40.0400.0408.67
5.0.30.0330.0608.50
5.0.20.0400.0378.30
5.0.10.0470.0408.37
5.0.00.0570.0438.43
4.4.90.0430.0176.56
4.4.80.0330.0236.56
4.4.70.0370.0236.56
4.4.60.0400.0206.56
4.4.50.0400.0236.56
4.4.40.0230.0436.56
4.4.30.0400.0276.56
4.4.20.0400.0236.56
4.4.10.0300.0206.56
4.4.00.0430.0306.56
4.3.110.0270.0306.56
4.3.100.0300.0276.56
4.3.90.0470.0236.56
4.3.80.0300.0406.56
4.3.70.0430.0206.56
4.3.60.0300.0276.56
4.3.50.0300.0336.56
4.3.40.0330.0506.56
4.3.30.0300.0206.56
4.3.20.0230.0336.56
4.3.10.0270.0276.56
4.3.00.0070.0176.74

preferences:
51.83 ms | 400 KiB | 5 Q