3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bitfinex { private $api_key; private $api_secret; private $api_version; private $base_url = 'https://api.bitfinex.com'; public function __construct($api_key, $api_secret, $api_version = 'v1') { $this->api_key = $api_key; $this->api_secret = $api_secret; $this->api_version = $api_version; } public function get_balances() { $request = '/' . $this->api_version . '/balances'; echo $request; $data = array( 'request' => $request, 'options' => array() ); return $this->send_signed_request($data); } private function prepare_header($data) { $data['nonce'] = 144800329405116; //(string) number_format(round(microtime(true) * 100000),0,'.',''); echo $data; echo '<br/>'; echo "Json encode"; echo '<br/>'; echo json_encode($data); echo '<br/>'; $payload = base64_encode(json_encode($data)); $signature = hash_hmac('sha384', $payload, $this->api_secret); echo "payload "; echo $payload; echo " sig "; echo $signature; echo " "; return array( 'X-BFX-APIKEY: ' . $this->api_key, 'X-BFX-PAYLOAD: ' . $payload, 'X-BFX-SIGNATURE: ' . $signature ); } private function send_signed_request($data) { $ch = curl_init(); $url = $this->base_url . $data['request']; // echo $url; $headers = $this->prepare_header($data); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => $headers, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_POSTFIELDS => "" )); $information = curl_getinfo($ch); echo $information; // echo $result; if( !$result = curl_exec($ch) ) { echo "NO <br/>"; return false; } else { echo "YES <br/>"; return json_decode($result, true); } } } $la = new Bitfinex('1', 'E8AeyGATKUFmWLSWLGSYznRFmaoboxgGPzmRzgn0G8x', '1'); $drek = $la->get_balances(); //$information = curl_getinfo($curl_exect); echo '<br/>'; echo 'Recived data'; //echo $drek; ?>

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.0110.00716.88
8.3.50.0040.01118.18
8.3.40.0040.01418.98
8.3.30.0060.01318.84
8.3.20.0000.00720.38
8.3.10.0040.00423.53
8.3.00.0080.00019.38
8.2.180.0070.01518.54
8.2.170.0130.00322.96
8.2.160.0100.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0100.00019.50
8.2.120.0000.00726.35
8.2.110.0030.00619.33
8.2.100.0040.00818.03
8.2.90.0060.00319.17
8.2.80.0040.00417.97
8.2.70.0040.00417.49
8.2.60.0080.00418.04
8.2.50.0140.00018.07
8.2.40.0000.00819.29
8.2.30.0040.00420.73
8.2.20.0000.01017.96
8.2.10.0080.00018.08
8.2.00.0000.00818.04
8.1.280.0030.01325.92
8.1.270.0090.00023.71
8.1.260.0000.00828.09
8.1.250.0050.00328.09
8.1.240.0040.00420.91
8.1.230.0090.00317.48
8.1.220.0040.00417.75
8.1.210.0000.00818.77
8.1.200.0060.00317.25
8.1.190.0040.00417.66
8.1.180.0050.00318.10
8.1.170.0040.00418.62
8.1.160.0040.00422.10
8.1.150.0040.00418.97
8.1.140.0080.00019.62
8.1.130.0000.00717.63
8.1.120.0050.00517.51
8.1.110.0000.00817.41
8.1.100.0000.00817.53
8.1.90.0040.00417.39
8.1.80.0060.00317.40
8.1.70.0030.00317.50
8.1.60.0000.00817.60
8.1.50.0090.00017.47
8.1.40.0050.00317.62
8.1.30.0030.00517.66
8.1.20.0040.00417.64
8.1.10.0000.00917.63
8.1.00.0050.00317.47
8.0.300.0070.00018.77
8.0.290.0000.00716.88
8.0.280.0000.00718.49
8.0.270.0030.00317.43
8.0.260.0030.00317.23
8.0.250.0000.00717.07
8.0.240.0030.00516.96
8.0.230.0030.00317.01
8.0.220.0070.00017.04
8.0.210.0000.00717.00
8.0.200.0000.00817.04
8.0.190.0040.00417.07
8.0.180.0000.00717.06
8.0.170.0030.00516.93
8.0.160.0070.00016.91
8.0.150.0050.00316.94
8.0.140.0040.00416.91
8.0.130.0030.00313.43
8.0.120.0040.00417.03
8.0.110.0030.00517.03
8.0.100.0050.00216.99
8.0.90.0000.00716.84
8.0.80.0030.01317.00
8.0.70.0050.00316.96
8.0.60.0080.00016.83
8.0.50.0040.00416.94
8.0.30.0140.00317.27
8.0.20.0080.01117.40
8.0.10.0000.00817.05
8.0.00.0070.01016.79
7.4.330.0060.00016.69
7.4.320.0030.00316.62
7.4.300.0060.00016.63
7.4.290.0050.00316.57
7.4.280.0060.00316.61
7.4.270.0070.00016.53
7.4.260.0070.00016.65
7.4.250.0000.00716.64
7.4.240.0050.00316.59
7.4.230.0030.00316.62
7.4.220.0090.00916.54
7.4.210.0070.00716.63
7.4.200.0000.00716.59
7.4.160.0190.00016.50
7.4.150.0180.01817.40
7.4.140.0120.00817.86
7.4.130.0060.01116.73
7.4.120.0060.01216.58
7.4.110.0100.00716.61
7.4.100.0190.00316.41
7.4.90.0150.00916.56
7.4.80.0100.01319.39
7.4.70.0000.01616.65
7.4.60.0070.01016.61
7.4.50.0060.00916.48
7.4.40.0080.00816.57
7.4.30.0180.00016.68
7.4.00.0030.01015.16
7.3.330.0080.00013.49
7.3.320.0030.00313.47
7.3.310.0030.00316.53
7.3.300.0000.00716.43
7.3.290.0040.00416.33
7.3.280.0110.00516.45
7.3.270.0110.00617.40
7.3.260.0030.01316.69
7.3.250.0080.01116.58
7.3.240.0120.00516.41
7.3.230.0130.01116.42
7.3.210.0070.01016.45
7.3.200.0030.01616.36
7.3.190.0100.00616.68
7.3.180.0070.01016.56
7.3.170.0080.00816.71
7.3.160.0080.00816.58
7.2.330.0070.01116.52
7.2.320.0070.01116.36
7.2.310.0070.01016.48
7.2.300.0090.00916.68
7.2.290.0060.00916.55
7.2.60.0070.00716.96
7.2.00.0000.01319.19
7.1.200.0070.00715.85
7.1.100.0030.01218.04
7.1.70.0070.01017.20
7.1.60.0060.01919.36
7.1.50.0030.00716.77
7.1.00.0030.08022.46
7.0.200.0050.00216.65
7.0.90.0670.08019.95
7.0.80.0700.07719.96
7.0.70.0570.07719.95
7.0.60.0600.08020.11
7.0.50.0600.07720.35
7.0.40.0070.04720.13
7.0.30.0070.09020.00
7.0.20.0170.07320.08
7.0.10.0070.08720.10
7.0.00.0100.07320.07
5.6.280.0030.06321.05
5.6.240.0230.05720.68
5.6.230.0130.07320.71
5.6.220.0070.08320.59
5.6.210.0100.08020.67
5.6.200.0070.09021.15
5.6.190.0030.04720.96
5.6.180.0130.07021.04
5.6.170.0100.07321.02
5.6.160.0030.04321.09
5.6.150.0100.07721.07
5.6.140.0070.04021.11
5.6.130.0200.07021.05
5.6.120.0130.07721.06
5.6.110.0030.06021.03
5.6.100.0170.03721.17
5.6.90.0030.07720.93
5.6.80.0030.06020.34
5.6.70.0100.08020.47
5.6.60.0130.08020.49
5.6.50.0130.07720.40
5.6.40.0100.07720.30
5.6.30.0130.07020.43
5.6.20.0070.07720.40
5.6.10.0130.06020.26
5.6.00.0070.07720.47
5.5.380.0130.06720.41
5.5.370.0130.07320.46
5.5.360.0070.07020.43
5.5.350.0070.04720.45
5.5.340.0070.08320.86
5.5.330.0070.04020.94
5.5.320.0030.07020.93
5.5.310.0070.07720.82
5.5.300.0170.07720.75
5.5.290.0170.07320.95
5.5.280.0100.08020.92
5.5.270.0100.04720.76
5.5.260.0170.07020.90
5.5.250.0200.07320.75
5.5.240.0070.08020.32
5.5.230.0070.06020.14
5.5.220.0170.06720.22
5.5.210.0170.06020.31
5.5.200.0030.07020.27
5.5.190.0100.07320.29
5.5.180.0230.06320.28
5.5.160.0100.05320.13
5.5.150.0100.08020.14
5.5.140.0100.07320.20
5.5.130.0070.07320.13
5.5.120.0130.07320.17
5.5.110.0100.07720.16
5.5.100.0030.07020.14
5.5.90.0230.05320.13
5.5.80.0100.08020.10
5.5.70.0100.07020.10
5.5.60.0070.08020.08
5.5.50.0100.07320.02
5.5.40.0100.06720.07
5.5.30.0030.07320.01
5.5.20.0030.08720.02
5.5.10.0100.06020.12
5.5.00.0070.08020.05

preferences:
38.2 ms | 401 KiB | 5 Q