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>'; //--------------------------------------------------------- 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.40.0120.00319.00
8.3.30.0110.00419.17
8.3.20.0050.00320.32
8.3.10.0040.00421.97
8.3.00.0000.00822.52
8.2.170.0100.01022.96
8.2.160.0060.00919.13
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0050.00319.61
8.2.110.0090.00022.25
8.2.100.0060.00619.57
8.2.90.0000.00819.30
8.2.80.0040.00418.05
8.2.70.0050.00317.75
8.2.60.0030.00517.93
8.2.50.0000.00818.07
8.2.40.0030.00620.01
8.2.30.0000.00718.12
8.2.20.0060.00317.91
8.2.10.0000.00817.65
8.2.00.0030.00617.86
8.1.270.0000.00822.15
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.80
8.1.230.0080.00419.07
8.1.220.0040.00417.79
8.1.210.0030.00618.77
8.1.200.0030.00717.35
8.1.190.0000.00817.55
8.1.180.0040.00418.71
8.1.170.0040.00418.64
8.1.160.0000.00922.09
8.1.150.0040.00418.65
8.1.140.0000.00817.55
8.1.130.0000.00717.72
8.1.120.0030.00517.53
8.1.110.0040.00417.36
8.1.100.0070.00017.52
8.1.90.0040.00417.54
8.1.80.0000.00817.40
8.1.70.0070.00017.43
8.1.60.0000.00917.59
8.1.50.0000.00717.53
8.1.40.0030.00517.57
8.1.30.0050.00317.66
8.1.20.0030.00617.63
8.1.10.0030.00617.53
8.1.00.0080.00017.54
8.0.300.0040.00418.77
8.0.290.0000.00917.16
8.0.280.0030.00318.48
8.0.270.0050.00217.37
8.0.260.0040.00416.90
8.0.250.0030.00317.05
8.0.240.0040.00417.14
8.0.230.0030.00317.19
8.0.220.0030.00317.04
8.0.210.0000.00717.12
8.0.200.0000.00717.13
8.0.190.0000.00717.17
8.0.180.0050.00316.98
8.0.170.0000.00817.06
8.0.160.0030.00617.08
8.0.150.0000.00817.10
8.0.140.0040.00416.93
8.0.130.0040.00413.53
8.0.120.0000.00917.06
8.0.110.0040.00417.01
8.0.100.0030.00517.11
8.0.90.0040.00417.08
8.0.80.0130.00317.02
8.0.70.0000.00817.11
8.0.60.0040.00416.97
8.0.50.0000.00717.07
8.0.30.0060.01317.10
8.0.20.0080.01117.40
8.0.10.0000.00717.11
8.0.00.0140.00616.74
7.4.330.0000.00515.00
7.4.320.0000.00616.55
7.4.300.0000.00616.63
7.4.290.0030.00316.55
7.4.280.0040.00416.62
7.4.270.0030.00316.67
7.4.260.0070.00016.63
7.4.250.0040.00416.66
7.4.240.0020.00516.62
7.4.230.0030.00316.68
7.4.220.0120.00616.68
7.4.210.0080.00916.65
7.4.200.0030.00316.37
7.4.190.0000.00716.70
7.4.160.0100.00616.73
7.4.150.0090.00917.40
7.4.140.0100.00817.86
7.4.130.0130.00416.69
7.4.120.0120.00616.73
7.4.110.0140.00716.63
7.4.100.0110.01516.47
7.4.90.0040.01516.55
7.4.80.0110.00619.39
7.4.70.0030.01316.62
7.4.60.0060.01216.67
7.4.50.0000.00816.58
7.4.40.0030.01322.77
7.4.30.0130.00916.52
7.4.00.0000.01615.16
7.3.330.0000.00513.51
7.3.320.0030.00313.54
7.3.310.0040.00416.52
7.3.300.0000.00716.55
7.3.290.0090.00616.52
7.3.280.0050.01516.51
7.3.270.0060.01017.40
7.3.260.0070.01016.59
7.3.250.0090.00816.52
7.3.240.0100.00716.64
7.3.230.0040.01316.39
7.3.210.0030.01316.31
7.3.200.0080.01419.39
7.3.190.0090.00916.36
7.3.180.0120.00616.66
7.3.170.0090.01216.45
7.3.160.0080.00816.43
7.3.120.0030.01014.83
7.3.110.0100.00314.87
7.3.100.0000.01214.65
7.3.90.0070.00714.68
7.3.80.0030.00614.65
7.3.70.0030.01014.71
7.3.60.0040.00714.83
7.3.50.0040.00814.59
7.3.40.0080.00815.01
7.3.30.0060.01014.93
7.3.20.0030.00916.67
7.3.10.0060.00616.54
7.3.00.0000.01216.84
7.2.330.0090.00916.90
7.2.320.0060.01216.39
7.2.310.0060.01016.39
7.2.300.0060.01216.90
7.2.290.0060.01116.79
7.2.240.0070.00714.88
7.2.230.0030.00915.21
7.2.220.0030.00915.14
7.2.210.0090.00414.88
7.2.200.0100.00314.81
7.2.190.0030.01314.80
7.2.180.0040.00814.95
7.2.170.0110.00015.14
7.2.160.0060.00614.96
7.2.150.0060.00916.96
7.2.140.0040.01417.04
7.2.130.0110.00416.80
7.2.120.0000.01317.01
7.2.110.0030.01216.93
7.2.100.0070.00716.74
7.2.90.0060.00616.90
7.2.80.0040.01116.88
7.2.70.0070.00717.02
7.2.60.0090.00716.83
7.2.50.0030.00717.05
7.2.40.0060.00917.01
7.2.30.0030.01016.64
7.2.20.0030.00616.66
7.2.10.0070.00716.92
7.2.00.0080.00418.48
7.1.330.0030.00815.77
7.1.320.0100.00315.50
7.1.310.0060.00315.83
7.1.300.0040.00415.61
7.1.290.0070.00715.85
7.1.280.0040.00815.73
7.1.270.0060.00615.91
7.1.260.0080.00415.82
7.1.250.0040.01116.00
7.1.200.0030.01015.95
7.1.100.0030.01018.41
7.1.70.0000.01017.32
7.1.60.0090.00619.82
7.1.50.0100.01617.13
7.1.00.0000.03722.60
7.0.200.0040.01117.20
7.0.140.0200.06022.55
7.0.60.0030.04020.27
7.0.50.0100.08318.19
7.0.40.0130.06720.46
7.0.30.0300.04320.50
7.0.20.0400.07720.45
7.0.10.0230.07320.56
7.0.00.0070.05320.46
5.6.280.0070.07021.42
5.6.210.0070.08320.80
5.6.200.0130.05018.52
5.6.190.0170.06321.07
5.6.180.0370.03721.03
5.6.170.0270.07720.83
5.6.160.0030.05320.94
5.6.150.0100.03718.41
5.6.140.0030.04018.73
5.6.130.0230.05018.61
5.6.120.0130.08321.30
5.6.110.0070.04021.26
5.6.100.0130.07021.22
5.6.90.0070.09021.47
5.6.80.0030.07320.84
5.5.350.0230.07720.87
5.5.340.0030.07018.29
5.5.330.0070.08320.95
5.5.320.0330.07320.61
5.5.310.0370.07720.65
5.5.300.0130.07718.34
5.5.290.0130.07718.54
5.5.280.0070.04321.29
5.5.270.0100.04021.20
5.5.260.0130.07721.40
5.5.250.0100.05320.81
5.5.240.0000.04020.64
5.4.450.0500.05019.65
5.4.440.0170.06319.74
5.4.430.0170.06019.77
5.4.420.0170.05719.52
5.4.410.0330.05019.54
5.4.400.0330.05318.74
5.4.390.0300.06718.99
5.4.380.0300.04718.86
5.4.370.0170.05318.95
5.4.360.0130.05318.70
5.4.350.0170.05018.70
5.4.340.0130.05719.04
5.4.320.0140.03512.52
5.4.310.0090.03412.52
5.4.300.0070.03912.51
5.4.290.0130.04012.51
5.4.280.0040.03712.41
5.4.270.0060.03612.41
5.4.260.0100.08319.04
5.4.250.0130.05019.03
5.4.240.0130.04718.81
5.4.230.0070.05719.16
5.4.220.0030.06319.04
5.4.210.0130.05319.18
5.4.200.0070.07319.17
5.4.190.0100.05019.03
5.4.180.0030.05719.00
5.4.170.0070.07719.17
5.4.160.0200.04319.15
5.4.150.0070.05719.20
5.4.140.0170.04016.60
5.4.130.0170.06016.55
5.4.120.0070.04716.40
5.4.110.0030.07716.49
5.4.100.0070.05016.47
5.4.90.0030.06016.51
5.4.80.0130.04316.32
5.4.70.0100.04716.53
5.4.60.0170.04016.35
5.4.50.0070.05016.30
5.4.40.0070.04716.53
5.4.30.0030.05316.44
5.4.20.0070.04716.36
5.4.10.0030.05716.58
5.4.00.0100.05316.00
5.3.290.0050.04612.80
5.3.280.0170.06714.69
5.3.270.0030.06314.58
5.3.260.0100.05014.79
5.3.250.0170.06014.75
5.3.240.0070.05314.64
5.3.230.0070.04714.69
5.3.220.0000.06014.54
5.3.210.0030.05714.56
5.3.200.0170.04014.74
5.3.190.0070.05314.73
5.3.180.0170.06314.66
5.3.170.0030.05314.75
5.3.160.0100.05014.40
5.3.150.0100.05714.57
5.3.140.0170.04714.65
5.3.130.0070.05314.69
5.3.120.0000.07014.61
5.3.110.0070.05314.55
5.3.100.0130.04314.13
5.3.90.0170.05714.15
5.3.80.0070.05013.93
5.3.70.0000.06314.04
5.3.60.0100.04714.11
5.3.50.0030.07313.97
5.3.40.0200.04714.13
5.3.30.0070.05313.98
5.3.20.0070.04713.72
5.3.10.0000.06013.73
5.3.00.0070.05013.82
5.2.170.0030.04311.25
5.2.160.0030.04311.15
5.2.150.0100.04011.24
5.2.140.0070.06011.23
5.2.130.0130.04311.20
5.2.120.0100.05311.19
5.2.110.0100.04711.27
5.2.100.0100.05311.27
5.2.90.0030.05311.18
5.2.80.0070.04011.08
5.2.70.0130.03311.09
5.2.60.0030.04710.89
5.2.50.0030.06010.94
5.2.40.0030.04011.00
5.2.30.0130.04311.05
5.2.20.0000.04310.88
5.2.10.0000.04310.95
5.2.00.0030.05010.90
5.1.60.0070.03310.05
5.1.50.0070.0309.98
5.1.40.0100.0339.96
5.1.30.0000.04010.18
5.1.20.0100.03310.26
5.1.10.0030.04010.12
5.1.00.0130.04010.07
5.0.50.0100.0238.52
5.0.40.0000.0338.67
5.0.30.0070.0478.20
5.0.20.0030.0338.18
5.0.10.0070.0338.18
5.0.00.0000.0438.24
4.4.90.0070.0277.11
4.4.80.0070.0177.11
4.4.70.0030.0207.11
4.4.60.0030.0207.11
4.4.50.0000.0237.11
4.4.40.0030.0477.11
4.4.30.0000.0237.11
4.4.20.0130.0207.11
4.4.10.0000.0237.11
4.4.00.0030.0377.11
4.3.110.0130.0107.11
4.3.100.0030.0207.11
4.3.90.0030.0207.11
4.3.80.0030.0437.11
4.3.70.0070.0277.11
4.3.60.0030.0177.11
4.3.50.0100.0277.11
4.3.40.0130.0337.11
4.3.30.0070.0177.11
4.3.20.0000.0237.11
4.3.10.0030.0277.11
4.3.00.0100.0237.28

preferences:
68.8 ms | 400 KiB | 5 Q