3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * TME API - code snippet. * * More info at: https://developers.tme.eu */ ini_set('display_errors', 1); error_reporting(E_ALL); $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.60.0150.00618.80
8.3.50.0050.01321.27
8.3.40.0060.00918.79
8.3.30.0110.01118.93
8.3.20.0030.00520.16
8.3.10.0080.00022.14
8.3.00.0000.00822.44
8.2.180.0040.01116.88
8.2.170.0110.00422.96
8.2.160.0040.01119.14
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00419.61
8.2.110.0090.00022.09
8.2.100.0130.00019.58
8.2.90.0000.00819.36
8.2.80.0040.00418.05
8.2.70.0030.00617.63
8.2.60.0080.00018.16
8.2.50.0000.00918.07
8.2.40.0090.00020.07
8.2.30.0040.00418.16
8.2.20.0030.00517.84
8.2.10.0000.00817.85
8.2.00.0080.00017.78
8.1.280.0090.00925.92
8.1.270.0000.00822.14
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0080.00023.84
8.1.230.0110.00019.20
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0050.00317.65
8.1.180.0090.00018.82
8.1.170.0040.00418.70
8.1.160.0080.00022.18
8.1.150.0000.00718.73
8.1.140.0050.00217.57
8.1.130.0000.00717.92
8.1.120.0040.00417.52
8.1.110.0000.00817.55
8.1.100.0080.00017.54
8.1.90.0000.00817.48
8.1.80.0000.00717.54
8.1.70.0000.00717.38
8.1.60.0030.00617.71
8.1.50.0000.00817.45
8.1.40.0000.00817.49
8.1.30.0080.00017.66
8.1.20.0060.00317.78
8.1.10.0040.00417.61
8.1.00.0040.00417.50
8.0.300.0050.00218.77
8.0.290.0000.00717.43
8.0.280.0000.00718.48
8.0.270.0020.00517.43
8.0.260.0030.00516.92
8.0.250.0080.00017.15
8.0.240.0030.00317.08
8.0.230.0030.00517.09
8.0.220.0000.00817.14
8.0.210.0000.00717.10
8.0.200.0000.00817.14
8.0.190.0050.00217.04
8.0.180.0050.00317.06
8.0.170.0040.00417.13
8.0.160.0000.00717.05
8.0.150.0040.00417.09
8.0.140.0040.00416.95
8.0.130.0000.00813.40
8.0.120.0060.00317.04
8.0.110.0030.00617.04
8.0.100.0070.00017.13
8.0.90.0050.00317.02
8.0.80.0040.01217.04
8.0.70.0060.00316.93
8.0.60.0030.00517.07
8.0.50.0000.00716.96
8.0.30.0130.00617.15
8.0.20.0140.00817.40
8.0.10.0040.00416.92
8.0.00.0070.01016.83
7.4.330.0000.00515.00
7.4.320.0030.00316.72
7.4.300.0060.00016.54
7.4.290.0070.00016.46
7.4.280.0040.00416.70
7.4.270.0040.00416.66
7.4.260.0000.00716.59
7.4.250.0000.00916.43
7.4.240.0040.00416.54
7.4.230.0000.00716.56
7.4.220.0150.00316.63
7.4.210.0050.01216.64
7.4.200.0040.00416.73
7.4.190.0000.00716.55
7.4.160.0060.01616.66
7.4.150.0150.00317.40
7.4.140.0070.01217.86
7.4.130.0120.00616.67
7.4.120.0090.00916.65
7.4.110.0090.00916.60
7.4.100.0100.01016.73
7.4.90.0060.01116.67
7.4.80.0120.00619.39
7.4.70.0060.01016.54
7.4.60.0120.00616.65
7.4.50.0080.00016.57
7.4.40.0110.00422.77
7.4.30.0100.00616.72
7.4.00.0040.00914.92
7.3.330.0030.00313.38
7.3.320.0000.00613.59
7.3.310.0070.00016.63
7.3.300.0060.00016.57
7.3.290.0080.00816.54
7.3.280.0120.01016.49
7.3.270.0090.00917.40
7.3.260.0070.01816.59
7.3.250.0120.00516.61
7.3.240.0080.01116.69
7.3.230.0120.00416.45
7.3.210.0170.00016.39
7.3.200.0130.01019.39
7.3.190.0060.01116.66
7.3.180.0130.00716.50
7.3.170.0140.00316.57
7.3.160.0080.00916.65
7.3.120.0060.00914.95
7.3.10.0140.00316.66
7.3.00.0130.00316.65
7.2.330.0060.01216.70
7.2.320.0060.01516.80
7.2.310.0140.00316.78
7.2.300.0060.01016.71
7.2.290.0070.01016.89
7.2.130.0040.00817.10
7.2.120.0090.00316.85
7.2.110.0100.00516.61
7.2.100.0040.00816.96
7.2.90.0070.00716.77
7.2.80.0060.00616.82
7.2.70.0030.01016.73
7.2.60.0110.00317.13
7.2.50.0040.01116.46
7.2.40.0090.00016.81
7.2.30.0030.01017.04
7.2.20.0060.00616.95
7.2.10.0090.00616.93
7.2.00.0040.00917.17
7.1.250.0100.00315.71
7.1.200.0000.00815.92
7.1.70.0090.00017.54
7.1.60.0090.01219.82
7.1.50.0030.02017.49
7.1.00.0000.03722.69
7.0.200.0030.00517.14
7.0.140.0030.07322.34
7.0.110.0630.07020.25
7.0.100.0570.04020.28
7.0.90.0530.08020.21
7.0.80.0500.06720.45
7.0.70.0570.07720.40
7.0.60.0600.08320.28
7.0.50.0430.07720.77
7.0.40.0130.05020.41
7.0.30.0100.07720.55
7.0.20.0000.09020.40
7.0.10.0070.08020.47
7.0.00.0070.08720.54
5.6.280.0000.07721.49
5.6.260.0100.04721.09
5.6.250.0070.07320.89
5.6.240.0070.08020.86
5.6.230.0100.04720.85
5.6.220.0070.04720.89
5.6.210.0130.08020.83
5.6.200.0000.07321.45
5.6.190.0200.06321.43
5.6.180.0170.06321.54
5.6.170.0000.08021.78
5.6.160.0030.08021.35
5.6.150.0170.06721.42
5.6.140.0000.06021.41
5.6.130.0170.06021.35
5.6.120.0070.09021.64
5.6.110.0130.08321.32
5.6.100.0170.06721.77
5.6.90.0070.08021.56
5.6.80.0030.08720.73
5.6.70.0130.08020.74
5.6.60.0170.07020.92
5.6.50.0070.04020.74
5.6.40.0030.08720.92
5.6.30.0170.06720.68
5.6.20.0070.08020.74
5.6.10.0030.08320.80
5.6.00.0030.08020.70
5.5.380.0000.08020.78
5.5.370.0070.07320.91
5.5.360.0030.08720.60
5.5.350.0100.08320.83
5.5.340.0000.04721.30
5.5.330.0200.06321.34
5.5.320.0100.08321.45
5.5.310.0130.07721.20
5.5.300.0070.07321.09
5.5.290.0070.06021.34
5.5.280.0100.08721.44
5.5.270.0100.07721.24
5.5.260.0100.05321.51
5.5.250.0100.06021.26
5.5.240.0130.07320.48
5.5.230.0100.07720.57
5.5.220.0100.03720.62
5.5.210.0100.08020.55
5.5.200.0030.08020.60
5.5.190.0070.08320.52
5.5.180.0170.06720.62
5.5.160.0100.07320.80
5.5.150.0170.04020.68
5.5.140.0070.06720.62
5.5.130.0100.08320.59
5.5.120.0100.07320.46
5.5.110.0100.07720.55
5.5.100.0100.07320.42
5.5.90.0100.07720.62
5.5.80.0100.07720.53
5.5.70.0100.07320.41
5.5.60.0000.05320.40
5.5.50.0130.07720.50
5.5.40.0030.05320.67
5.5.30.0070.08020.54
5.5.20.0130.07020.61
5.5.10.0030.08020.53
5.5.00.0100.04720.63
5.4.450.0000.05719.52
5.4.440.0100.07319.72
5.4.430.0100.07019.72
5.4.420.0070.05020.05
5.4.410.0070.07719.91
5.4.400.0000.07719.72
5.4.390.0100.07019.72
5.4.380.0070.08319.25
5.4.370.0130.03019.27
5.4.360.0030.07319.25
5.4.350.0070.05719.55
5.4.340.0130.07319.41
5.4.320.0100.07319.55
5.4.310.0170.07019.55
5.4.300.0000.08319.26
5.4.290.0130.07019.46
5.4.280.0130.06719.71
5.4.270.0070.06019.28
5.4.260.0070.07319.46
5.4.250.0030.07719.71
5.4.240.0030.07719.46
5.4.230.0130.07019.26
5.4.220.0200.06719.25
5.4.210.0030.07319.23
5.4.200.0130.06719.23
5.4.190.0130.07019.70
5.4.180.0070.07319.24
5.4.170.0170.07319.46
5.4.160.0070.03319.21
5.4.150.0130.07319.70
5.4.140.0100.07016.48
5.4.130.0100.06716.50
5.4.120.0130.07016.27
5.4.110.0070.05716.41
5.4.100.0070.07016.36
5.4.90.0070.04016.57
5.4.80.0100.06316.49
5.4.70.0030.04316.26
5.4.60.0100.06716.34
5.4.50.0100.03716.24
5.4.40.0030.05016.39
5.4.30.0070.07716.41
5.4.20.0070.04316.54
5.4.10.0000.04716.52
5.4.00.0100.06715.72
5.3.290.0000.05014.71
5.3.280.0100.07314.59
5.3.270.0100.06714.58
5.3.260.0130.06014.48
5.3.250.0100.07314.62
5.3.240.0030.03314.70
5.3.230.0000.08314.63
5.3.220.0070.07014.80
5.3.210.0070.07014.58
5.3.200.0030.08014.43
5.3.190.0100.07014.72
5.3.180.0000.08014.71
5.3.170.0130.06314.58
5.3.160.0070.05014.57
5.3.150.0100.07314.70
5.3.140.0130.07014.60
5.3.130.0100.04714.69
5.3.120.0130.07014.52
5.3.110.0030.04014.59
5.3.100.0130.05714.07
5.3.90.0100.06714.04
5.3.80.0030.05714.25
5.3.70.0100.04314.06
5.3.60.0030.03714.07
5.3.50.0000.04014.04
5.3.40.0100.04013.95
5.3.30.0030.04013.88
5.3.20.0030.03713.70
5.3.10.0000.03713.70
5.3.00.0070.03313.74
5.2.170.0000.03312.38
5.2.160.0070.02712.38
5.2.150.0030.03312.38
5.2.140.0000.04012.38
5.2.130.0030.03312.38
5.2.120.0030.03012.38
5.2.110.0100.02312.38
5.2.100.0000.03012.38
5.2.90.0000.03312.38
5.2.80.0000.03312.38
5.2.70.0070.02312.38
5.2.60.0000.03712.38
5.2.50.0030.02712.38
5.2.40.0000.03012.38
5.2.30.0000.03012.38
5.2.20.0000.02712.38
5.2.10.0000.02712.38
5.2.00.0070.04712.38
5.1.60.0000.02712.38
5.1.50.0000.02712.38
5.1.40.0030.02012.38
5.1.30.0030.03312.38
5.1.20.0030.02712.38
5.1.10.0030.02012.38
5.1.00.0030.03012.38
5.0.50.0100.03712.38
5.0.40.0000.03012.38
5.0.30.0000.03312.38
5.0.20.0000.03012.38
5.0.10.0030.03012.38
5.0.00.0000.03012.38
4.4.90.0000.01712.38
4.4.80.0000.01712.38
4.4.70.0030.01312.38
4.4.60.0030.01312.38
4.4.50.0000.01712.38
4.4.40.0070.01712.38
4.4.30.0000.01312.38
4.4.20.0030.01312.38
4.4.10.0030.01312.38
4.4.00.0030.04012.38
4.3.110.0030.01712.38
4.3.100.0000.02712.38
4.3.90.0000.02312.38
4.3.80.0000.02312.38
4.3.70.0000.01312.38
4.3.60.0030.02012.38
4.3.50.0030.01312.38
4.3.40.0030.02012.38
4.3.30.0000.02312.38
4.3.20.0000.01712.38
4.3.10.0000.01312.38
4.3.00.0030.01312.38

preferences:
45.16 ms | 401 KiB | 5 Q