3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * TME API - code snippet. * * More info at: https://developers.tme.eu */ $token = 'b050bd709a43eecc443820c022b6774ca703ddb216b6f6765f';//'<put_your_token_here>'; $app_secret = '5656847466f0e5d08577';//<put_your_app_secret_here>'; $params = array( 'SymbolList' => array('1N4007'), 'Country' => 'PL', 'Currency' => 'PLN', 'Language' => 'PL', ); $response = api_call('Products/GetPrices', $params, $token, $app_secret, true); $result = json_decode($response, true); var_dump(PHP_VERSION); echo '<pre>'; print_r($result); echo '</pre>'; $w = stream_get_wrappers(); echo 'openssl: ', extension_loaded ('openssl') ? 'yes':'no', "\n"; echo 'http wrapper: ', in_array('http', $w) ? 'yes':'no', "\n"; echo 'https wrapper: ', in_array('https', $w) ? 'yes':'no', "\n"; echo 'wrappers: ', var_dump($w); //--------------------------------------------------------- function api_call($action, $params, $token, $app_secret, $show_header=false) { $api_url = 'https://api.tme.eu/' . $action . '.json'; // calculate HMAC-SHA1 signature $params['Token'] = $token; ksort($params); // In PHP 5.4 http_build_query() offers enc_type parameter (PHP_QUERY_RFC3986) which replaces bellow snippet. $encoded_params = str_replace( array('+', '%7E'), array('%20', '~'), http_build_query($params) ); $signature_base = 'POST' . '&' . rawurlencode($api_url) . '&' . rawurlencode($encoded_params); $api_signature = base64_encode(hash_hmac('sha1', $signature_base, $app_secret, true)); $params['ApiSignature'] = $api_signature; $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ); return file_get_contents($api_url, false, stream_context_create($opts)); }

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.0130.01016.75
8.3.50.0120.00517.56
8.3.40.0120.00319.02
8.3.30.0140.00018.96
8.3.20.0050.00318.74
8.3.10.0080.00020.48
8.3.00.0040.00419.38
8.2.180.0120.00316.88
8.2.170.0040.01122.96
8.2.160.0140.00321.23
8.2.150.0080.00025.66
8.2.140.0090.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00019.48
8.2.110.0060.00321.05
8.2.100.0080.00417.68
8.2.90.0070.00320.90
8.2.80.0060.00318.16
8.2.70.0000.00817.63
8.2.60.0090.00017.93
8.2.50.0040.00418.07
8.2.40.0030.00618.34
8.2.30.0030.00618.17
8.2.20.0000.00717.83
8.2.10.0040.00417.71
8.2.00.0000.00717.89
8.1.280.0110.00425.92
8.1.270.0050.00324.66
8.1.260.0000.00826.35
8.1.250.0030.00628.09
8.1.240.0060.00320.84
8.1.230.0110.00020.95
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0050.00317.52
8.1.180.0060.00318.10
8.1.170.0080.00018.92
8.1.160.0080.00018.93
8.1.150.0000.00718.61
8.1.140.0040.00417.37
8.1.130.0030.00317.89
8.1.120.0050.00217.52
8.1.110.0030.00517.54
8.1.100.0050.00217.45
8.1.90.0020.00517.39
8.1.80.0000.00717.33
8.1.70.0030.00317.50
8.1.60.0080.00017.46
8.1.50.0000.00817.55
8.1.40.0030.00517.55
8.1.30.0000.00817.71
8.1.20.0030.00517.69
8.1.10.0050.00317.67
8.1.00.0000.00817.41
8.0.300.0000.00720.15
8.0.290.0000.00716.88
8.0.280.0030.00318.54
8.0.270.0000.00817.33
8.0.260.0070.00016.98
8.0.250.0040.00417.04
8.0.240.0050.00317.00
8.0.230.0000.00817.08
8.0.220.0100.00017.09
8.0.210.0030.00316.96
8.0.200.0000.00717.14
8.0.190.0080.00017.15
8.0.180.0000.00716.98
8.0.170.0000.00817.08
8.0.160.0040.00417.01
8.0.150.0000.00917.02
8.0.140.0040.00417.00
8.0.130.0030.00313.47
8.0.120.0080.00017.07
8.0.110.0000.00817.07
8.0.100.0000.00817.13
8.0.90.0050.00316.95
8.0.80.0080.00817.09
8.0.70.0000.00717.05
8.0.60.0000.00716.93
8.0.50.0020.00516.86
8.0.30.0110.00917.34
8.0.20.0080.01217.14
8.0.10.0080.00017.02
8.0.00.0140.00516.78
7.4.330.0000.00513.02
7.4.320.0070.00316.68
7.4.300.0000.00716.55
7.4.290.0070.00016.65
7.4.280.0040.00416.56
7.4.270.0030.00316.70
7.4.260.0000.00513.32
7.4.250.0030.00516.52
7.4.240.0070.00016.57
7.4.230.0070.00016.41
7.4.220.0110.01116.71
7.4.210.0070.00916.72
7.4.200.0050.00316.32
7.4.190.0070.00016.79
7.4.160.0100.00716.68
7.4.150.0120.00616.75
7.4.140.0070.01216.58
7.4.130.0130.00816.58
7.4.120.0090.01216.56
7.4.110.0140.00316.59
7.4.100.0170.00316.64
7.4.90.0040.01416.53
7.4.80.0130.01019.39
7.4.70.0070.01716.61
7.4.60.0100.01016.39
7.4.50.0030.00316.33
7.4.40.0100.00616.60
7.4.30.0040.01416.59
7.4.00.0070.01015.17
7.3.330.0030.00313.39
7.3.320.0030.00313.45
7.3.310.0000.00816.56
7.3.300.0030.00316.51
7.3.290.0110.00416.53
7.3.280.0140.00616.52
7.3.270.0050.01116.77
7.3.260.0180.00016.45
7.3.250.0090.01216.46
7.3.240.0100.00716.45
7.3.230.0140.00316.52
7.3.210.0120.00616.72
7.3.200.0120.00616.46
7.3.190.0110.01416.84
7.3.180.0080.01116.68
7.3.170.0110.00716.75
7.3.160.0130.00316.73
7.3.120.0030.01214.97
7.2.330.0070.01116.90
7.2.320.0140.00716.78
7.2.310.0040.01516.80
7.2.300.0100.01316.80
7.2.290.0060.00916.55
7.2.60.0110.00416.72
7.2.00.0110.00719.91
7.1.200.0030.00615.99
7.1.100.0090.00618.43
7.1.70.0040.01117.20
7.1.60.0090.01519.40
7.1.50.0030.02317.52
7.1.00.0030.03722.66
7.0.200.0260.00415.10
7.0.140.0030.07322.61
7.0.120.0030.07722.38
7.0.60.0130.08320.35
7.0.50.0000.04718.21
7.0.40.0130.08720.53
7.0.30.0270.08320.57
7.0.20.0130.04720.44
7.0.10.0070.04020.63
7.0.00.0070.08720.46
5.6.280.0100.07021.23
5.6.210.0100.07021.11
5.6.200.0070.08718.41
5.6.190.0030.07721.14
5.6.180.0400.05321.11
5.6.170.0130.04720.81
5.6.160.0000.04320.83
5.6.150.0070.08018.73
5.6.140.0170.07018.43
5.6.130.0100.05018.57
5.6.120.0100.05721.55
5.6.110.0170.07721.34
5.6.100.0100.06721.29
5.6.90.0070.08021.29
5.6.80.0070.03720.83
5.5.350.4070.04020.95
5.5.340.0030.05318.25
5.5.330.0000.04320.85
5.5.320.0430.07320.63
5.5.310.0200.04720.61
5.5.300.0130.06718.38
5.5.290.0170.05718.30
5.5.280.0070.08321.27
5.5.270.0100.05021.40
5.5.260.0030.04321.16
5.5.250.0000.04320.82
5.5.240.0100.04020.48
5.4.450.0070.05719.99
5.4.440.0000.05020.11
5.4.430.0100.07720.18
5.4.420.0100.08020.06
5.4.410.0070.04319.80
5.4.400.0070.07719.75
5.4.390.0170.05019.56
5.4.380.0030.06719.77
5.4.370.0100.06019.76
5.4.360.0170.04719.79
5.4.350.0030.07019.70
5.4.340.0030.04019.71
5.4.320.0100.08319.61
5.4.310.0070.08019.85
5.4.300.0200.07019.78
5.4.290.0130.04719.57
5.4.280.0030.04019.55
5.4.270.0030.08019.70
5.4.260.0030.06319.71
5.4.250.0070.04019.54
5.4.240.0130.07019.69
5.4.230.0070.08019.59
5.4.220.0070.04019.57
5.4.210.0070.07019.60
5.4.200.0070.04719.60
5.4.190.0130.05019.66
5.4.180.0300.05719.69
5.4.170.0070.04719.59
5.4.160.0070.07319.53
5.4.150.0030.05719.58
5.4.140.0170.02716.34
5.4.130.0070.04016.29
5.4.120.0100.05316.40
5.4.110.0100.05316.34
5.4.100.0030.05016.43
5.4.90.0070.04316.30
5.4.80.0070.07316.66
5.4.70.0000.06316.39
5.4.60.0130.03016.40
5.4.50.0070.04316.41
5.4.40.0030.04016.26
5.4.30.0100.03016.25
5.4.20.0100.04316.52
5.4.10.0130.04316.36
5.4.00.0070.07315.98
5.3.290.0030.07314.70
5.3.280.0130.07014.66
5.3.270.0030.04314.62
5.3.260.0030.05714.63
5.3.250.0070.07314.63
5.3.240.0030.05714.67
5.3.230.0100.04714.66
5.3.220.0030.07314.59
5.3.210.0100.07714.75
5.3.200.0170.04714.61
5.3.190.0100.07714.65
5.3.180.0100.06714.61
5.3.170.0030.04014.64
5.3.160.0130.03714.61
5.3.150.0070.05714.57
5.3.140.0030.04314.60
5.3.130.0030.04714.58
5.3.120.0030.07314.60
5.3.110.0070.03714.48
5.3.100.0170.06714.04
5.3.90.0070.06014.18
5.3.80.0130.06314.06
5.3.70.0100.03314.08
5.3.60.0000.04014.04
5.3.50.0130.06014.02
5.3.40.0100.03313.88
5.3.30.0030.08013.92
5.3.20.0070.06713.72
5.3.10.0030.06713.59
5.3.00.0070.05713.65
5.2.170.0000.03711.11
5.2.160.0030.03011.32
5.2.150.0030.03711.24
5.2.140.0030.06311.23
5.2.130.0030.04711.07
5.2.120.0070.03711.18
5.2.110.0000.06711.12
5.2.100.0030.05711.07
5.2.90.0030.03711.15
5.2.80.0100.05711.18
5.2.70.0130.05711.11
5.2.60.0030.04711.22
5.2.50.0030.06711.04
5.2.40.0030.03311.18
5.2.30.0030.03711.05
5.2.20.0170.05311.13
5.2.10.0000.06310.89
5.2.00.0100.05310.74
5.1.60.0170.0439.97
5.1.50.0100.05010.04
5.1.40.0070.0539.98
5.1.30.0100.05010.35
5.1.20.0000.06010.42
5.1.10.0030.05010.00
5.1.00.0000.0339.99
5.0.50.0000.0478.57
5.0.40.0070.0408.46
5.0.30.0030.0338.42
5.0.20.0000.0208.42
5.0.10.0000.0208.42
5.0.00.0000.0378.42
4.4.90.0000.0378.42
4.4.80.0000.0308.42
4.4.70.0070.0338.42
4.4.60.0000.0378.42
4.4.50.0030.0408.42
4.4.40.0070.0338.42
4.4.30.0000.0408.42
4.4.20.0070.0278.42
4.4.10.0030.0208.42
4.4.00.0030.0308.42
4.3.110.0030.0138.42
4.3.100.0030.0138.42
4.3.90.0000.0178.42
4.3.80.0000.0278.42
4.3.70.0000.0178.42
4.3.60.0000.0138.42
4.3.50.0030.0138.42
4.3.40.0030.0208.42
4.3.30.0000.0178.42
4.3.20.0000.0178.42
4.3.10.0070.0108.42
4.3.00.0000.0138.42

preferences:
43.94 ms | 401 KiB | 5 Q