3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Vircurex API Auto trader - functions.php Written by: Frozennova Version 1.1 Date: 23/12/2013 */ date_default_timezone_set("UTC"); function balance($cur,$user_name,$secret_word) { $t = date("Y-m-d\TH:i:s", time()); $year = date("Y", time()); $trx_id = hash("sha256", $t."-".rand()); // $tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";get_balance;" . $cur); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/get_balance.json?account=$user_name&id=$trx_id&token=$tok&timestamp=$t&currency=" .$cur); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $resp = curl_exec($ch); $resp = json_decode($resp,true); if (!isset($resp['availablebalance'])) { $resp['availablebalance'] = "0.00"; } return $resp['availablebalance']; } function get_sell_price($cur,$user_name,$secret_word) { $t = date("Y-m-d\TH:i:s", time()); $year = date("Y", time()); $trx_id = hash("sha256", $t."-".rand()); // $tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";get_balance;" . $cur); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/get_highest_bid.json?base=" . $cur . "&alt=BTC"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $resp = curl_exec($ch); $resp = json_decode($resp,true); return $resp['value']; } function get_buy_price($cur,$user_name,$secret_word) { $t = date("Y-m-d\TH:i:s", time()); $year = date("Y", time()); $trx_id = hash("sha256", $t."-".rand()); // $tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";get_balance;" . $cur); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/get_lowest_ask.json?base=" . $cur . "&alt=BTC"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $resp = curl_exec($ch); $resp = json_decode($resp,true); return $resp['value']; } function buy_coin($cur,$qty,$price,$user_name,$secret_word) { $t = date("Y-m-d\TH:i:s", time()); $year = date("Y", time()); $trx_id = hash("sha256", $t."-".rand()); // $tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";create_order;buy;$qty;$cur;$price;btc"); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/create_order.json?account=$user_name&id=$trx_id&token=$tok&timestamp=$t&ordertype=buy&amount=$qty&currency1=$cur&unitprice=$price&currency2=btc"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $resp = curl_exec($ch); return $resp; } function sell_coin($cur,$price,$qty,$user_name,$secret_word) { $t = date("Y-m-d\TH:i:s", time()); $year = date("Y", time()); $trx_id = hash("sha256", $t."-".rand()); // $tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";create_order;sell;$qty;$cur;$price;btc"); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/create_order.json?account=$user_name&id=$trx_id&token=$tok&timestamp=$t&ordertype=sell&amount=$qty&currency1=$cur&unitprice=$price&currency2=btc"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $resp = curl_exec($ch); return $resp; } function get_orders($user_name,$secret_word) { $t = date("Y-m-d\TH:i:s", time()); $year = date("Y", time()); $trx_id = hash("sha256", $t."-".rand()); // $tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";read_orders"); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/read_orders.json?account=$user_name&id=$trx_id&token=$tok&timestamp=$t&otype=0"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $resp = curl_exec($ch); $resp = json_decode($resp,true); $i = 0; if (isset($resp)) { foreach($resp as $val) { if (isset($val['orderid'])) { $unreleased_orders[$i] = $val['orderid']; $i++; } } } if(isset($unreleased_orders)){ return $unreleased_orders; } } function release_order($orderid,$user_name,$secret_word) { $t = date("Y-m-d\TH:i:s", time()); $year = date("Y", time()); $trx_id = hash("sha256", $t."-".rand()); // $tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";release_order;$orderid"); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/release_order.json?account=$user_name&id=$trx_id&token=$tok&timestamp=$t&orderid=$orderid"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $resp = curl_exec($ch); $resp = json_decode($resp,true); return $resp; } function read_order($orderid,$user_name,$secret_word) { $t = date("Y-m-d\TH:i:s", time()); $year = date("Y", time()); $trx_id = hash("sha256", $t."-".rand()); // $tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";read_order;$orderid"); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/read_order.json?account=$user_name&id=$trx_id&token=$tok&timestamp=$t&otype=0&orderid=$orderid"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $resp = curl_exec($ch); $resp = json_decode($resp,true); return $resp['order']; } ?>

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.1.70.0040.00416.87
7.1.60.0190.00619.82
7.1.50.0100.01316.83
7.1.00.0070.07322.45
7.0.200.0000.00816.75
7.0.140.0030.07322.09
7.0.80.0470.07720.19
7.0.70.0700.05320.05
7.0.60.0600.07019.95
7.0.50.0570.08020.40
7.0.40.0030.05320.20
7.0.30.0070.07020.08
7.0.20.0070.05020.05
7.0.10.0030.08720.07
7.0.00.0030.07319.95
5.6.280.0000.07721.14
5.6.230.0070.07320.67
5.6.220.0130.06320.69
5.6.210.0030.04720.49
5.6.200.0070.05321.18
5.6.190.0030.09021.07
5.6.180.0070.04721.09
5.6.170.0030.06021.02
5.6.160.0100.03321.00
5.6.150.0100.08021.13
5.6.140.0070.06021.08
5.6.130.0130.07721.07
5.6.120.0100.08721.00
5.6.110.0100.05020.99
5.6.100.0070.08321.12
5.6.90.0030.08721.09
5.6.80.0070.08020.56
5.6.70.0000.08320.55
5.6.60.0130.04320.38
5.6.50.0130.05720.58
5.6.40.0030.04720.38
5.6.30.0030.04020.36
5.6.20.0000.04320.50
5.6.10.0030.04020.52
5.6.00.0130.05720.36
5.5.370.0070.04020.41
5.5.360.0070.05020.39
5.5.350.0070.04720.38
5.5.340.0130.07320.95
5.5.330.0170.08020.89
5.5.320.0100.07720.96
5.5.310.0100.08020.89
5.5.300.0070.07320.94
5.5.290.0030.04320.86
5.5.280.0100.04720.93
5.5.270.0130.04320.67
5.5.260.0000.08720.86
5.5.250.0030.08720.65
5.5.240.0200.07020.37
5.5.230.0130.06720.25
5.5.220.0130.06320.26
5.5.210.0070.03720.31
5.5.200.0100.04020.30
5.5.190.0030.04720.29
5.5.180.0070.04320.31
5.5.160.0100.03320.34
5.5.150.0000.04020.30
5.5.140.0030.03720.18
5.5.130.0030.03720.34
5.5.120.0030.04320.18
5.5.110.0030.03720.33
5.5.100.0070.04320.14
5.5.90.0130.03720.23
5.5.80.0100.04020.15
5.5.70.0170.06020.16
5.5.60.0000.04020.12
5.5.50.0000.04320.16
5.5.40.0030.03320.12
5.5.30.0130.02720.16
5.5.20.0030.04020.14
5.5.10.0030.04720.09
5.5.00.0100.03020.12
5.4.450.0030.06019.42
5.4.440.0000.04319.18
5.4.430.0000.05019.20
5.4.420.0070.09019.45
5.4.410.0100.03319.10
5.4.400.0170.04019.19
5.4.390.0070.04319.09
5.4.380.0070.04318.84
5.4.370.0170.03019.03
5.4.360.0130.06019.07
5.4.350.0030.04019.12
5.4.340.0030.04018.91
5.4.320.0070.03718.90
5.4.310.0070.03319.12
5.4.300.0030.03719.03
5.4.290.0000.04019.02
5.4.280.0030.04719.02
5.4.270.0030.04319.13
5.4.260.0030.06019.09
5.4.250.0100.03019.12
5.4.240.0070.07719.22
5.4.230.0000.04019.12
5.4.220.0070.03719.11
5.4.210.0070.05319.04
5.4.200.0070.04018.94
5.4.190.0130.02719.04
5.4.180.0030.04318.89
5.4.170.0030.05318.89
5.4.160.0030.05319.02
5.4.150.0000.04018.98
5.4.140.0070.03716.50
5.4.130.0030.03716.34
5.4.120.0100.06016.43
5.4.110.0000.04016.48
5.4.100.0130.06316.45
5.4.90.0030.04716.45
5.4.80.0030.06316.53
5.4.70.0000.03716.43
5.4.60.0030.06016.49
5.4.50.0100.03016.51
5.4.40.0030.03716.45
5.4.30.0000.03316.49
5.4.20.0000.05316.49
5.4.10.0030.04016.29
5.4.00.0000.04015.95
5.3.290.0100.03314.78
5.3.280.0070.03314.64
5.3.270.0000.04014.80
5.3.260.0000.06314.66
5.3.250.0000.04014.79
5.3.240.0030.03714.62
5.3.230.0030.03714.68
5.3.220.0030.04314.61
5.3.210.0000.04014.75
5.3.200.0000.03714.59
5.3.190.0100.03014.59
5.3.180.0030.03314.71
5.3.170.0030.05714.64
5.3.160.0000.04014.72
5.3.150.0000.04014.63
5.3.140.0000.04314.71
5.3.130.0000.04014.73
5.3.120.0100.03014.57
5.3.110.0030.04014.63
5.3.100.0070.03314.14
5.3.90.0000.03714.14
5.3.80.0000.04014.16
5.3.70.0070.03314.21
5.3.60.0000.04714.08
5.3.50.0000.04014.05
5.3.40.0000.04014.10
5.3.30.0030.07314.12
5.3.20.0070.07713.71
5.3.10.0130.06713.89
5.3.00.0100.06313.84

preferences:
34.43 ms | 400 KiB | 5 Q