3v4l.org

run code in 300+ PHP versions simultaneously
<?php function api_query($method, array $req = array()) { // Obtain API keys under settings. $publickey = 'd3498a999932fae8e5f80fba1046dfea234bdd47'; $privatekey = '68a629e1fe9fd59f5e62d4c080c5e0d488ab19c07605ba408a26ff7703df3b3c3e74745fb546f978'; $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, $privatekey); // generate the extra headers $headers = array( 'Sign: '.$sign, 'Key: '.$publickey, ); // 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; Tux API PHP client; '.php_uname('s').'; PHP/'.phpversion().')'); } curl_setopt($ch, CURLOPT_URL, 'https://tuxexchange.com/api'); 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; } // get ticker data $result = api_query("getticker"); // Get my withdraw history $result = api_query("getmywithdrawhistory"); // Get mybalances $result = api_query("getmybalances"); // Get mybalances $result = api_query("getmyopenorders"); // buy/sell/cancel $result = api_query("buy", array("coin" => "DOGE" ,"market" => "BTC", "amount" => "1", "price" => "0.00000038")); $result = api_query("sell", array("coin" => "DOGE" ,"market" => "BTC", "amount" => "1", "price" => "0.00000038")); // cancelorder $result = api_query("cancelorder", array("id" => "1234123", "market" => "BTC")); // Request a withdraw. $result = api_query("withdraw", array("coin" => "DOGE","address" => "DM2DasYjU1RWePFSLHFJqFMBtHSWbKmHpR", "amount" => "300")); >

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.2.40.0940.01417.42
7.2.30.0780.00917.61
7.2.20.0630.01017.68
7.2.10.0760.01017.62
7.2.00.0780.01217.88
7.1.160.0670.01016.58
7.1.150.0860.01616.54
7.1.140.0650.01216.77
7.1.130.0590.00816.43
7.1.120.0710.01016.89
7.1.110.0740.01016.32
7.1.100.1030.00916.14
7.1.90.0720.00815.76
7.1.80.0810.01015.71
7.1.70.0210.01015.75
7.1.60.0790.00834.05
7.1.50.0280.01633.59
7.1.40.0300.01433.33
7.1.30.0330.01333.38
7.1.20.0350.01233.53
7.1.10.0120.01015.36
7.1.00.0190.01115.40
7.0.290.0920.00916.07
7.0.270.0720.00916.41
7.0.260.0630.01016.05
7.0.250.0830.01115.90
7.0.240.0970.01015.89
7.0.230.0830.00915.70
7.0.220.0790.00915.79
7.0.210.0550.01014.73
7.0.200.0280.01015.69
7.0.190.0150.01015.66
7.0.180.0130.01115.08
7.0.170.0170.00915.17
7.0.160.0140.01015.07
7.0.150.0170.00715.19
7.0.140.0180.01215.45
7.0.130.0140.01115.30
7.0.120.0120.01115.45
7.0.110.0170.00715.31
7.0.100.0130.01115.20
7.0.90.0150.00815.40
7.0.80.0150.00915.32
7.0.70.0200.00815.16
7.0.60.0240.00815.15
7.0.50.0260.01015.17
7.0.40.0180.01215.60
7.0.30.0250.01115.40
7.0.20.0430.01015.34
7.0.10.0370.01015.24
7.0.00.0640.00815.37
5.6.300.0100.06820.78
5.6.290.0130.06120.79
5.6.280.0110.06920.88
5.6.270.0100.07120.90
5.6.260.0120.07320.86
5.6.250.0130.06421.05
5.6.240.0110.06220.91
5.6.230.0160.06620.92
5.6.220.0090.07320.79
5.6.210.0180.07620.85
5.6.200.0140.06721.01
5.6.190.0140.06320.79
5.6.180.0140.07020.90
5.6.170.0180.07120.83
5.6.160.0190.06020.79
5.6.150.0110.07820.92
5.6.140.0130.06720.93
5.6.130.0100.06820.80
5.6.120.0120.06920.88
5.6.110.0090.07620.92
5.6.100.0120.07120.91
5.6.90.0160.05920.91
5.6.80.0090.06220.22
5.6.70.0090.05720.16
5.6.60.0140.05720.36
5.6.50.0110.06120.38
5.6.40.0140.06720.16
5.6.30.0140.06320.22
5.6.20.0120.05620.20
5.6.10.0090.06920.21
5.6.00.0100.06720.20
5.5.380.0140.06017.58
5.5.370.0070.06117.46
5.5.360.0180.05517.58
5.5.350.0110.06017.44
5.5.340.0150.05717.87
5.5.330.0170.04917.96
5.5.320.0140.06417.90
5.5.310.0120.07118.08
5.5.300.0170.06317.88
5.5.290.0100.06617.73
5.5.280.0120.07717.92
5.5.270.0160.06417.90
5.5.260.0110.06417.84
5.5.250.0120.06617.73
5.5.240.0090.05717.25
5.5.230.0070.06217.20
5.5.220.0100.05917.26
5.5.210.0100.06817.27
5.5.200.0120.06017.29
5.5.190.0100.06417.32
5.5.180.0130.06817.26
5.5.160.0110.06417.38
5.5.150.0070.05617.39
5.5.140.0100.06117.44
5.5.130.0090.05517.38
5.5.120.0120.06317.40
5.5.110.0170.04717.07
5.5.100.0090.05417.26
5.5.90.0120.05117.33
5.5.80.0110.05016.99
5.5.70.0100.05417.12
5.5.60.0140.06217.15
5.5.50.0140.05817.28
5.5.40.0070.05717.28
5.5.30.0140.04817.23
5.5.20.0090.05417.23
5.5.10.0130.05117.18
5.5.00.0110.05817.26
5.4.450.0120.06619.29
5.4.440.0120.06619.46
5.4.430.0170.06019.36
5.4.420.0090.06719.20
5.4.410.0100.06219.28
5.4.400.0110.05219.13
5.4.390.0150.06219.07
5.4.380.0110.05319.05
5.4.370.0130.06718.86
5.4.360.0160.05919.09
5.4.350.0120.05418.98
5.4.340.0140.06419.10
5.4.320.0130.06419.02
5.4.310.0110.05419.04
5.4.300.0120.05718.93
5.4.290.0080.05919.12
5.4.280.0100.05719.08
5.4.270.0080.06718.98
5.4.260.0140.05919.00
5.4.250.0120.05419.00
5.4.240.0100.05419.14
5.4.230.0100.05219.18
5.4.220.0120.06618.93
5.4.210.0110.05419.07
5.4.200.0090.06518.99
5.4.190.0130.05019.13
5.4.180.0150.04818.97
5.4.170.0120.05719.01
5.4.160.0070.05819.01
5.4.150.0090.06119.15
5.4.140.0160.05116.66
5.4.130.0130.05816.48
5.4.120.0120.06316.59
5.4.110.0140.05716.52
5.4.100.0100.05716.42
5.4.90.0100.04816.66
5.4.80.0080.05016.53
5.4.70.0130.04916.61
5.4.60.0070.05516.65
5.4.50.0100.04916.70
5.4.40.0150.05316.69
5.4.30.0070.06816.53
5.4.20.0090.05616.55
5.4.10.0040.05816.52
5.4.00.0150.05816.07
5.3.290.0120.05414.85
5.3.280.0140.05214.75
5.3.270.0110.06614.80
5.3.260.0060.06114.71
5.3.250.0090.05714.80
5.3.240.0130.06114.86
5.3.230.0140.06014.82
5.3.220.0100.05014.66
5.3.210.0080.06514.78
5.3.200.0070.06314.59
5.3.190.0080.05214.71
5.3.180.0070.05114.75
5.3.170.0130.04914.65
5.3.160.0100.05114.79
5.3.150.0090.05414.68
5.3.140.0130.06214.77
5.3.130.0110.05714.71
5.3.120.0130.05514.86
5.3.110.0160.05314.59
5.3.100.0060.05814.14
5.3.90.0080.06314.12
5.3.80.0120.05914.13
5.3.70.0120.06214.16
5.3.60.0090.06114.13
5.3.50.0090.06314.19
5.3.40.0130.05314.00
5.3.30.0090.04914.16
5.3.20.0110.06513.92
5.3.10.0100.05813.81
5.3.00.0100.05713.62
5.2.170.0070.05111.33
5.2.160.0070.05211.29
5.2.150.0110.04711.40
5.2.140.0130.05211.10
5.2.130.0110.04511.34
5.2.120.0070.05011.06
5.2.110.0090.04411.30
5.2.100.0080.04711.00
5.2.90.0070.04311.24
5.2.80.0120.03911.16
5.2.70.0100.04411.34
5.2.60.0020.04811.32
5.2.50.0070.04311.19
5.2.40.0100.03711.18
5.2.30.0090.04011.12
5.2.20.0100.03711.22
5.2.10.0110.03810.86
5.2.00.0050.04910.79
5.1.60.0070.03610.11
5.1.50.0050.03910.31
5.1.40.0070.03610.17
5.1.30.0100.03910.54
5.1.20.0080.04310.55
5.1.10.0060.04510.30
5.1.00.0090.04310.30
5.0.50.0070.0308.81
5.0.40.0090.0238.66
5.0.30.0070.0418.32
5.0.20.0060.0298.46
5.0.10.0070.0288.38
5.0.00.0080.0508.09
4.4.90.0070.0207.23
4.4.80.0030.0247.23
4.4.70.0040.0227.23
4.4.60.0070.0217.23
4.4.50.0040.0227.23
4.4.40.0070.0347.23
4.4.30.0080.0267.23
4.4.20.0050.0277.23
4.4.10.0050.0257.23
4.4.00.0060.0327.23
4.3.110.0050.0227.23
4.3.100.0050.0207.23
4.3.90.0050.0217.23
4.3.80.0060.0367.23
4.3.70.0030.0257.23
4.3.60.0040.0247.23
4.3.50.0060.0187.23
4.3.40.0040.0367.23
4.3.30.0050.0227.23
4.3.20.0060.0207.23
4.3.10.0040.0227.23
4.3.00.0050.0257.23

preferences:
148.99 ms | 1386 KiB | 7 Q