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'; $curl = curl_init(); // 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; //-- curl_setopt($curl, CURLOPT_URL, $api_url); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_HEADER, 1); $response = curl_exec($curl); $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); $header = substr($response, 0, $header_size); $body = substr($response, $header_size); if($show_header){ print_r($header); } curl_close($curl); return $body; }

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.48
8.3.50.0130.00521.02
8.3.40.0180.00318.66
8.3.30.0090.00918.67
8.3.20.0080.00018.90
8.3.10.0040.00419.33
8.3.00.0070.00023.48
8.2.180.0110.01116.75
8.2.170.0070.00722.96
8.2.160.0090.00920.48
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0000.00819.49
8.2.110.0000.01020.52
8.2.100.0000.01218.03
8.2.90.0040.00419.22
8.2.80.0040.00418.05
8.2.70.0060.00317.38
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0000.00718.22
8.2.30.0050.00219.72
8.2.20.0040.00417.81
8.2.10.0000.00717.76
8.2.00.0080.00017.91
8.1.280.0180.00325.92
8.1.270.0040.00423.99
8.1.260.0040.01126.35
8.1.250.0040.00428.09
8.1.240.0150.00422.50
8.1.230.0000.01220.91
8.1.220.0040.00418.77
8.1.210.0000.00818.95
8.1.200.0030.00617.38
8.1.190.0030.00617.53
8.1.180.0050.00318.10
8.1.170.0040.00418.57
8.1.160.0000.00818.98
8.1.150.0040.00418.69
8.1.140.0090.00017.52
8.1.130.0030.00317.79
8.1.120.0080.00017.52
8.1.110.0060.00317.39
8.1.100.0040.00417.47
8.1.90.0000.00717.43
8.1.80.0040.00417.47
8.1.70.0000.00717.38
8.1.60.0050.00317.60
8.1.50.0040.00417.40
8.1.40.0000.00817.62
8.1.30.0000.00717.71
8.1.20.0040.00417.57
8.1.10.0000.00717.64
8.1.00.0040.00717.47
8.0.300.0040.00420.16
8.0.290.0040.00417.30
8.0.280.0000.00718.55
8.0.270.0000.00717.29
8.0.260.0000.00917.03
8.0.250.0050.00317.01
8.0.240.0030.00617.00
8.0.230.0000.00716.97
8.0.220.0000.00716.87
8.0.210.0000.00716.93
8.0.200.0030.00317.14
8.0.190.0050.00217.03
8.0.180.0040.00416.92
8.0.170.0040.00416.91
8.0.160.0040.00416.96
8.0.150.0040.00416.83
8.0.140.0000.00716.96
8.0.130.0030.00313.39
8.0.120.0060.00316.96
8.0.110.0000.00916.86
8.0.100.0040.00416.80
8.0.90.0040.00416.80
8.0.80.0090.00916.93
8.0.70.0070.00016.81
8.0.60.0040.00417.02
8.0.50.0040.00416.84
8.0.30.0170.00316.96
8.0.20.0050.01417.40
8.0.10.0060.00316.92
8.0.00.0080.01016.75
7.4.330.0030.00314.76
7.4.320.0030.00316.47
7.4.300.0030.00316.64
7.4.290.0000.00816.65
7.4.280.0070.00016.44
7.4.270.0030.00316.64
7.4.260.0000.00513.33
7.4.250.0000.00716.60
7.4.240.0030.00316.64
7.4.230.0000.00816.71
7.4.220.0090.00916.64
7.4.210.0110.00716.59
7.4.200.0000.00816.30
7.4.190.0030.00716.61
7.4.160.0120.00316.44
7.4.150.0140.00417.40
7.4.140.0090.01217.86
7.4.130.0110.00616.63
7.4.120.0090.00816.43
7.4.110.0090.00916.61
7.4.100.0110.00916.59
7.4.90.0170.00316.80
7.4.80.0100.00719.37
7.4.70.0050.01116.71
7.4.60.0070.01016.48
7.4.50.0030.00616.48
7.4.40.0090.00622.27
7.4.30.0120.00916.60
7.4.10.0100.00616.32
7.4.00.0030.01515.54
7.3.330.0020.00213.23
7.3.320.0050.00013.21
7.3.310.0000.00716.38
7.3.300.0000.00916.38
7.3.290.0070.00716.38
7.3.280.0080.00816.39
7.3.270.0170.00717.40
7.3.260.0120.01118.24
7.3.250.0090.00916.55
7.3.240.0100.00716.59
7.3.230.0060.01216.65
7.3.210.0070.01116.61
7.3.200.0110.00819.39
7.3.190.0090.00916.63
7.3.180.0030.01316.50
7.3.170.0100.00616.53
7.3.160.0120.00416.66
7.3.130.0070.00716.52
7.3.120.0030.01415.58
7.3.110.0040.01216.50
7.3.100.0100.00616.44
7.3.90.0040.00716.61
7.3.80.0030.00916.45
7.3.70.0060.00616.39
7.3.60.0110.00616.54
7.3.50.0040.00816.22
7.3.40.0040.01116.33
7.3.30.0080.00616.38
7.3.20.0040.01118.21
7.3.10.0030.01218.07
7.3.00.0130.00318.18
7.2.330.0150.00316.32
7.2.320.0080.00816.61
7.2.310.0110.00716.71
7.2.300.0110.00616.82
7.2.290.0160.00016.27
7.2.260.0030.01416.75
7.2.250.0040.01716.78
7.2.240.0110.00416.38
7.2.230.0040.00816.41
7.2.220.0080.00816.63
7.2.210.0040.01116.61
7.2.200.0060.01016.38
7.2.190.0100.00316.48
7.2.180.0090.00616.35
7.2.170.0070.01016.46
7.2.160.0040.00716.52
7.2.150.0080.00418.26
7.2.140.0040.01118.36
7.2.130.0130.00018.41
7.2.120.0070.00318.33
7.2.110.0070.00318.32
7.2.100.0030.00718.22
7.2.90.0000.01218.20
7.2.80.0070.01118.41
7.2.70.0070.01018.29
7.2.60.0060.01117.51
7.2.50.0060.00918.30
7.2.40.0060.00618.31
7.2.30.0110.00318.17
7.2.20.0030.00718.33
7.2.10.0000.01018.16
7.2.00.0060.00918.16
7.1.330.0070.00717.17
7.1.320.0070.00717.20
7.1.310.0050.00517.16
7.1.300.0120.00417.38
7.1.290.0060.00617.18
7.1.280.0000.01417.21
7.1.270.0100.00317.25
7.1.260.0000.01417.43
7.1.250.0030.00917.38
7.1.240.0100.00317.28
7.1.230.0030.00717.21
7.1.220.0030.00717.20
7.1.210.0060.00317.22
7.1.200.0070.00716.55
7.1.190.0070.00717.19
7.1.180.0060.01017.09
7.1.170.0100.00317.33
7.1.160.0000.01117.29
7.1.150.0000.01017.30
7.1.140.0030.00617.17
7.1.130.0060.00917.37
7.1.120.0030.01017.02
7.1.110.0030.01317.36
7.1.100.0030.00817.29
7.1.90.0000.01717.18
7.1.80.0100.01017.33
7.1.70.0060.00916.93
7.1.60.0070.01218.36
7.1.50.0100.01117.04
7.1.40.0100.00717.35
7.1.30.0000.01617.21
7.1.20.0150.00017.26
7.1.10.0130.00317.32
7.1.00.0030.02219.82
7.0.330.0050.00517.10
7.0.320.0030.00616.80
7.0.310.0040.00717.09
7.0.300.0060.00917.07
7.0.290.0000.00917.00
7.0.280.0060.00616.89
7.0.270.0070.00317.14
7.0.260.0070.01016.92
7.0.250.0070.00716.99
7.0.240.0100.00617.08
7.0.230.0090.00617.30
7.0.220.0040.01117.02
7.0.210.0030.01416.96
7.0.200.0020.00916.75
7.0.190.0060.00916.87
7.0.180.0070.01017.13
7.0.170.0000.01216.93
7.0.160.0060.01016.92
7.0.150.0030.00916.97
7.0.140.0080.03719.54
7.0.130.0120.00316.86
7.0.120.0000.01616.93
7.0.110.0030.01017.07
7.0.100.0080.00517.13
7.0.90.0120.00416.76
7.0.80.0100.00716.73
7.0.70.0030.01016.97
7.0.60.0030.03719.41
7.0.50.0030.04019.54
7.0.40.0050.03317.58
7.0.30.0050.04717.52
7.0.20.0080.04717.49
7.0.10.0040.03917.60
7.0.00.0060.04517.51
5.6.400.0000.01115.95
5.6.390.0000.01415.86
5.6.380.0030.01215.92
5.6.370.0090.00315.63
5.6.360.0090.00615.95
5.6.350.0060.01016.18
5.6.340.0100.00715.95
5.6.330.0060.00615.76
5.6.320.0060.00615.56
5.6.310.0070.01015.93
5.6.300.0000.01616.03
5.6.290.0030.01616.03
5.6.280.0020.04618.58
5.6.270.0030.01016.03
5.6.260.0050.00515.91
5.6.250.0070.01015.82
5.6.240.0030.01415.82
5.6.230.0110.00715.98
5.6.220.0100.00715.61
5.6.210.0050.04218.09
5.6.200.0020.05218.41
5.6.190.0080.03718.47
5.6.180.0090.03818.40
5.6.170.0030.03818.63
5.6.160.0050.04418.34
5.6.150.0070.04418.54
5.6.140.0040.04418.42
5.6.130.0040.04818.45
5.6.120.0130.03818.34
5.6.110.0070.04618.45
5.6.100.0110.04118.52
5.6.90.0070.04518.55
5.6.80.0070.04518.06
5.6.70.0060.04118.21
5.6.60.0050.04218.09
5.6.50.0120.03718.11
5.6.40.0100.04117.97
5.6.30.0030.04818.29
5.6.20.0060.04318.18
5.6.10.0120.03718.05
5.6.00.0040.04618.23
5.5.380.0000.01215.90
5.5.370.0040.00815.87
5.5.360.0030.01015.71
5.5.350.0020.04818.08
5.5.340.0070.04518.35
5.5.330.0080.04218.24
5.5.320.0070.04018.16
5.5.310.0060.04418.30
5.5.300.0020.04518.38
5.5.290.0070.04318.38
5.5.280.0080.03618.33
5.5.270.0040.04718.33
5.5.260.0030.04418.26
5.5.250.0050.04618.15
5.5.240.0050.04517.95
5.5.230.0060.03817.95
5.5.220.0050.04717.95
5.5.210.0070.04018.03
5.5.200.0040.04418.01
5.5.190.0050.03717.94
5.5.180.0130.03717.88
5.5.170.0040.00815.76
5.5.160.0050.04417.78
5.5.150.0050.04517.89
5.5.140.0070.03817.89
5.5.130.0050.04217.88
5.5.120.0050.04117.88
5.5.110.0070.02517.91
5.5.100.0030.04617.81
5.5.90.0080.04117.85
5.5.80.0030.02717.80
5.5.70.0070.04017.79
5.5.60.0050.04117.87
5.5.50.0120.03517.93
5.5.40.0050.03217.98
5.5.30.0040.04217.92
5.5.20.0060.04017.89
5.5.10.0050.04317.92
5.5.00.0050.04317.91
5.4.450.0020.04416.12
5.4.440.0050.03816.05
5.4.430.0030.04315.82
5.4.420.0060.03915.94
5.4.410.0030.04416.00
5.4.400.0050.03915.90
5.4.390.0040.02815.74
5.4.380.0050.03915.78
5.4.370.0050.03815.83
5.4.360.0050.04415.87
5.4.350.0030.04215.69
5.4.340.0060.04315.88
5.4.330.0040.00812.73
5.4.320.0030.04315.92
5.4.310.0050.03915.81
5.4.300.0070.03915.86
5.4.290.0030.04415.76
5.4.280.0050.02815.76
5.4.270.0040.04015.96
5.4.260.0000.04415.71
5.4.250.0020.04315.75
5.4.240.0020.04015.72
5.4.230.0040.04115.83
5.4.220.0050.03815.84
5.4.210.0030.03215.77
5.4.200.0010.03115.75
5.4.190.0050.04215.78
5.4.180.0100.03715.83
5.4.170.0060.03815.81
5.4.160.0050.04015.91
5.4.150.0050.04015.75
5.4.140.0000.04414.41
5.4.130.0020.04114.47
5.4.120.0030.03814.49
5.4.110.0030.03914.54
5.4.100.0020.04014.62
5.4.90.0060.04014.55
5.4.80.0070.03614.39
5.4.70.0020.03014.51
5.4.60.0080.03014.49
5.4.50.0050.03714.46
5.4.40.0030.03914.46
5.4.30.0000.03714.45
5.4.20.0070.03414.43
5.4.10.0020.03914.45
5.4.00.0070.03514.25
5.3.290.0030.07714.64
5.3.280.0030.07314.57
5.3.270.0000.07014.73
5.3.260.0030.08014.73
5.3.250.0000.07314.64
5.3.240.0030.08014.66
5.3.230.0070.07314.55
5.3.220.0000.08014.55
5.3.210.0000.08014.55
5.3.200.0030.04314.50
5.3.190.0070.07014.55
5.3.180.0070.05714.58
5.3.170.0070.06714.55
5.3.160.0000.07714.65
5.3.150.0100.06314.59
5.3.140.0070.05014.59
5.3.130.0070.07714.49
5.3.120.0100.06314.48
5.3.110.0000.07014.63
5.3.100.0030.07714.09
5.3.90.0100.06314.04
5.3.80.0030.07714.09
5.3.70.0070.08014.09
5.3.60.0070.06014.06
5.3.50.0000.07313.98
5.3.40.0000.07314.04
5.3.30.0030.06013.98
5.3.20.0030.07013.81
5.3.10.0000.07313.53
5.3.00.0000.07313.66
5.2.170.0000.06711.08
5.2.160.0000.06711.29
5.2.150.0000.04311.15
5.2.140.0000.06711.24
5.2.130.0000.06011.22
5.2.120.0030.06311.19
5.2.110.0000.06310.98
5.2.100.0000.06011.18
5.2.90.0000.06711.17
5.2.80.0000.04011.20
5.2.70.0000.03310.97
5.2.60.0030.05711.13
5.2.50.0000.06311.05
5.2.40.0030.04011.09
5.2.30.0130.04711.05
5.2.20.0000.06311.00
5.2.10.0070.05311.00
5.2.00.0100.04710.60
5.1.60.0030.05010.35
5.1.50.0000.03310.35
5.1.40.0000.05010.35
5.1.30.0030.05310.45
5.1.20.0030.05310.36
5.1.10.0070.05010.35
5.1.00.0030.04310.35
5.0.50.0030.04310.35
5.0.40.0000.04310.35
5.0.30.0100.05710.35
5.0.20.0000.04310.35
5.0.10.0000.03710.35
5.0.00.0000.06710.35
4.4.90.0000.03710.35
4.4.80.0000.03010.35
4.4.70.0030.02710.35
4.4.60.0000.03310.35
4.4.50.0000.03710.35
4.4.40.0030.04310.35
4.4.30.0030.01710.35
4.4.20.0000.03710.35
4.4.10.0070.03010.35
4.4.00.0030.05010.35
4.3.110.0070.02710.35
4.3.100.0000.03010.35
4.3.90.0000.03310.35
4.3.80.0000.05710.35
4.3.70.0070.03010.35
4.3.60.0000.02710.35
4.3.50.0000.03710.35
4.3.40.0000.04710.35
4.3.30.0030.03710.35
4.3.20.0000.04010.35
4.3.10.0000.03710.35
4.3.00.0030.03710.35

preferences:
45.34 ms | 401 KiB | 5 Q