3v4l.org

run code in 300+ PHP versions simultaneously
<?php function btce_query($method, array $req = array()) { // API settings $key = 'OCM7MMKC-6NZGJD3U-9CA6UZQK-XD4FQEJT-1RJWY7MV'; // your API-key $secret = '867ebdf127a2d0aff48dad5363fb558addd25d12a640e564d3396b7356434b5e'; // your Secret-key $req['method'] = $method; $mt = explode(' ', microtime()); $req['nonce'] = $mt[1]; // generate the POST data string $post_data = http_build_query($req, '', '&'); $sign = hash_hmac('sha512', $post_data, $secret); // generate the extra headers $headers = array( 'Sign: '.$sign, 'Key: '.$key, ); // our curl handle (initialize if required) static $ch = null; if (is_null($ch)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; BTCE PHP client; '.php_uname('s').'; PHP/'.phpversion().')'); } curl_setopt($ch, CURLOPT_URL, 'https://btc-e.com/tapi/'); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // run the query $res = curl_exec($ch); if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch)); $dec = json_decode($res, true); if (!$dec) throw new Exception('Invalid data received, please make sure connection is working and requested API exists'); return $dec; } $result = btce_query('getInfo'); //$result = btce_query('Trade', array('pair' => 'btc_usd', 'type' => 'buy', 'amount' => 1, 'rate' => 10)); //buy 1 BTC @ 10 USD var_dump($result); ?>

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)
7.4.00.0110.00715.22
7.3.120.0120.00615.13
7.3.110.0070.01014.87
7.3.100.0030.01514.91
7.3.90.0100.00014.88
7.3.80.0000.01014.70
7.3.70.0030.00714.84
7.3.60.0000.01414.95
7.3.50.0080.00814.89
7.3.40.0040.00415.05
7.3.30.0090.00614.75
7.3.20.0040.01416.78
7.3.10.0000.01316.83
7.3.00.0030.00716.54
7.2.250.0120.00014.72
7.2.240.0070.01315.16
7.2.230.0000.01515.07
7.2.220.0000.01314.76
7.2.210.0100.00014.99
7.2.200.0120.00015.20
7.2.190.0060.00914.90
7.2.180.0000.01115.19
7.2.170.0040.00915.14
7.2.00.0070.00719.35
7.1.330.0070.01015.81
7.1.320.0030.01015.95
7.1.310.0030.00715.89
7.1.300.0140.00015.96
7.1.290.0040.00815.90
7.1.280.0070.00715.84
7.1.270.0030.00715.55
7.1.260.0060.01015.82
7.1.70.0100.00317.25
7.1.60.0070.01319.17
7.1.50.0160.01017.03
7.1.00.0100.02722.40
7.0.200.0070.01014.85
7.0.140.0000.08022.18
7.0.100.0030.04020.02
7.0.90.0070.04319.89
7.0.80.0100.03719.99
7.0.70.0100.03719.95
7.0.60.0030.04019.96
7.0.50.0100.04720.35
7.0.40.0170.03020.08
7.0.30.0100.03720.13
7.0.20.0030.04020.10
7.0.10.0030.04320.02
7.0.00.0130.03319.98
5.6.280.0030.07020.84
5.6.250.0000.03720.83
5.6.240.0070.03720.68
5.6.230.0070.06720.61
5.6.220.0030.04320.59
5.6.210.0070.04320.64
5.6.200.0070.04021.00
5.6.190.0000.04321.10
5.6.180.0000.04721.20
5.6.170.0070.04021.02
5.6.160.0030.06721.11
5.6.150.0030.04020.98
5.6.140.0030.04021.03
5.6.130.0070.04021.07
5.6.120.0170.06721.15
5.6.110.0130.05721.04
5.6.100.0070.08321.15
5.6.90.0100.04321.11
5.6.80.0100.07020.49
5.6.70.0270.06020.34
5.6.60.0030.03720.40
5.6.50.0130.07020.36
5.6.40.0030.08320.40
5.6.30.0130.05020.50
5.6.20.0030.08720.42
5.6.10.0100.08020.55
5.6.00.0070.06320.50
5.5.380.0070.05020.59
5.5.370.0100.04020.44
5.5.360.0030.04320.57
5.5.350.0000.04320.44
5.5.340.0100.03720.78
5.5.330.0030.04020.82
5.5.320.0130.03320.95
5.5.310.0030.04020.66
5.5.300.0030.04020.90
5.5.290.0070.04720.77
5.5.280.0130.08720.88
5.5.270.0070.07320.79
5.5.260.0130.03720.79
5.5.250.0130.06720.75
5.5.240.0130.07320.24
5.5.230.0100.04320.20
5.5.220.0000.04320.27
5.5.210.0130.06720.28
5.5.200.0130.06720.20
5.5.190.0030.07720.17
5.5.180.0070.07720.26
5.5.160.0100.08020.13
5.5.150.0100.07020.14
5.5.140.0130.07320.29
5.5.130.0000.06720.16
5.5.120.0070.06320.25
5.5.110.0070.03720.01
5.5.100.0070.07020.13
5.5.90.0130.05020.18
5.5.80.0130.07020.08
5.5.70.0070.04719.95
5.5.60.0270.06020.16
5.5.50.0100.07020.12
5.5.40.0130.05020.05
5.5.30.0070.04720.13
5.5.20.0070.06719.99
5.5.10.0100.07720.05
5.5.00.0030.08020.15
5.4.450.0100.06019.23
5.4.440.0100.07719.20
5.4.430.0030.06719.53
5.4.420.0070.05019.45
5.4.410.0070.05019.36
5.4.400.0030.05719.23
5.4.390.0030.07019.04
5.4.380.0070.04018.88
5.4.370.0030.05018.84
5.4.360.0000.08319.23
5.4.350.0070.07318.88
5.4.340.0070.07319.05
5.4.320.0000.08319.20
5.4.310.0070.08019.05
5.4.300.0070.06719.23
5.4.290.0130.05019.20
5.4.280.0100.04318.84
5.4.270.0000.05019.18
5.4.260.0070.08018.90
5.4.250.0130.07019.11
5.4.240.0130.06718.87
5.4.230.0170.06719.12
5.4.220.0070.05719.20
5.4.210.0030.05318.90
5.4.200.0170.07318.91
5.4.190.0100.07019.08
5.4.180.0100.07319.20
5.4.170.0130.06319.12
5.4.160.0030.05318.93
5.4.150.0100.06719.01
5.4.140.0170.05316.38
5.4.130.0030.07316.40
5.4.120.0070.04016.30
5.4.110.0000.04316.48
5.4.100.0000.07316.39
5.4.90.0030.07316.40
5.4.80.0000.04316.44
5.4.70.0070.03716.43
5.4.60.0100.06016.48
5.4.50.0100.03716.46
5.4.40.0070.06716.54
5.4.30.0100.07016.31
5.4.20.0070.07316.43
5.4.10.0030.07316.26
5.4.00.0070.06015.85
5.3.290.0070.07014.71
5.3.280.0030.05314.75
5.3.270.0030.08014.69
5.3.260.0070.07714.59
5.3.250.0030.06714.59
5.3.240.0030.06014.57
5.3.230.0030.06714.71
5.3.220.0000.04014.54
5.3.210.0130.06014.57
5.3.200.0070.03314.69
5.3.190.0130.07314.53
5.3.180.0070.06714.64
5.3.170.0070.07314.70
5.3.160.0130.06714.64
5.3.150.0030.07314.72
5.3.140.0070.04014.59
5.3.130.0100.07014.52
5.3.120.0030.08014.71
5.3.110.0100.09714.63
5.3.100.0030.07714.00
5.3.90.0100.07014.17
5.3.80.0030.06314.10
5.3.70.0070.03714.09
5.3.60.0070.07014.04
5.3.50.0130.03314.04
5.3.40.0030.07714.06
5.3.30.0000.08013.99
5.3.20.0100.07313.83
5.3.10.0070.06713.57
5.3.00.0070.07713.71
5.2.170.0030.06011.69
5.2.160.0070.05711.69
5.2.150.0100.03311.69
5.2.140.0030.06311.69
5.2.130.0070.05011.69
5.2.120.0030.06711.69
5.2.110.0030.05711.69
5.2.100.0000.05711.69
5.2.90.0000.06011.69
5.2.80.0030.06711.69
5.2.70.0100.04711.69
5.2.60.0100.05711.69
5.2.50.0030.06011.69
5.2.40.0000.05311.69
5.2.30.0070.06311.69
5.2.20.0070.04311.69
5.2.10.0100.04711.69
5.2.00.0070.06011.69
5.1.60.0000.04311.69
5.1.50.0070.02711.69
5.1.40.0100.05011.69
5.1.30.0030.04711.69
5.1.20.0070.05311.69
5.1.10.0100.05311.69
5.1.00.0100.04711.69
5.0.50.0030.04311.69
5.0.40.0000.03711.69
5.0.30.0030.07011.69
5.0.20.0070.04311.69
5.0.10.0000.04711.69
5.0.00.0030.04311.69
4.4.90.0000.03711.69
4.4.80.0030.03311.69
4.4.70.0070.03311.69
4.4.60.0030.03711.69
4.4.50.0030.03311.69
4.4.40.0030.05311.69
4.4.30.0000.03711.69
4.4.20.0030.03311.69
4.4.10.0000.03711.69
4.4.00.0070.04711.69
4.3.110.0000.03311.69
4.3.100.0000.03011.69
4.3.90.0030.02711.69
4.3.80.0030.05311.69
4.3.70.0030.02311.69
4.3.60.0000.03711.69
4.3.50.0030.03311.69
4.3.40.0070.03011.69
4.3.30.0000.03311.69
4.3.20.0030.02311.69
4.3.10.0000.04011.69
4.3.00.0000.02011.69

preferences:
37.83 ms | 401 KiB | 5 Q