3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Client { private $language = ''; private $hashing_key = ''; function __construct($hashing_key, $language='en-US') { $this->language = $language; $this->hashing_key = $hashing_key; } public function call($url, $method, $vars, $headers) { if (!array_key_exists('app_key', $headers)) $headers['app_key'] = $vars['app_key']; if (!array_key_exists('user_email', $headers)) $headers['user_email'] = $vars['user_email']; if (!array_key_exists('auth_token', $headers)) $headers['auth_token'] = ''; $headers['Accept-Language'] = $this->language; $headers['request_timestamp'] = gmdate('c'); $headers['request_body'] = $vars; $headers['request_url'] = $url; $headers['request_method'] = $method; $headers['api_signature'] = $this->get_signature($headers); $request_body = $this->encode_post_data($vars); $headers['request_body'] = $request_body; $url = $this->encode_query_string($url); $headers['request_url'] = $url; $curl = new Curl(); $curl->headers = $headers; $response = $curl->request(strtoupper($method), $url, $vars); $rv = array(); $rv['body'] = json_decode($response->body, true); $rv['headers'] = $response->headers; $rv['exception'] =$rv['body']['exception']; $rv['http_status_code'] = $rv['body']['http_status_code']; $rv['auth_token'] = $rv['body']['auth_token']; $rv['body'] = $rv['body']['body']; return $rv; } function encode_query_string($url) { $pos = strpos($url, '?',0); if ($pos !== false) { $qs = substr($url,$pos+1); $qs = rawurlencode(urldecode($qs)); $url = substr($url,0, $pos+1) . $qs; } return $url; } function encode_post_data($vars) { $request_body = ''; if ($vars) { foreach ($vars AS $key=>$value) { if (is_array($value)) $request_body .= $this->urlencode_array($value, $key).'&'; else $request_body .= $key.'='.$value.'&'; } $request_body = rtrim($request_body, '&'); } return $request_body; } function get_signature($vars) { $key = $this->hashing_key; $message = $vars['auth_token'] . $vars['app_key'] . $vars['user_email'] . $vars['request_timestamp'] . $this->encode_post_data($vars['request_body']) .$this->encode_query_string($vars['request_url']) . $vars['request_method']; return base64_encode(hash_hmac('sha512', $message, hash('sha512', $this->hashing_key))); } function urlencode_array($var, $varName, $separator = '&') { $toImplode = array(); foreach ($var as $key => $value) { if (is_array($value)) $toImplode[] = urlencode_array($value, "{$varName}[{$key}]", $separator); else $toImplode[] = "{$varName}[{$key}]=".rawurlencode(urldecode($value)); } return implode($separator, $toImplode); } } ?>

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.0140.00016.75
8.3.50.0080.00817.19
8.3.40.0110.00718.71
8.3.30.0090.00618.59
8.3.20.0030.00518.64
8.3.10.0030.00520.28
8.3.00.0160.00319.22
8.2.180.0120.00916.38
8.2.170.0090.00922.96
8.2.160.0140.00021.07
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00819.24
8.2.110.0100.00020.84
8.2.100.0040.00717.72
8.2.90.0050.00519.08
8.2.80.0000.00817.91
8.2.70.0030.00517.50
8.2.60.0040.00418.04
8.2.50.0050.00318.07
8.2.40.0080.00018.09
8.2.30.0040.00418.16
8.2.20.0050.00517.56
8.2.10.0000.00817.60
8.2.00.0090.00017.66
8.1.280.0130.00325.92
8.1.270.0000.00724.66
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0060.00320.96
8.1.230.0090.00320.79
8.1.220.0080.00017.74
8.1.210.0030.00519.07
8.1.200.0060.00317.22
8.1.190.0080.00017.30
8.1.180.0090.00018.10
8.1.170.0000.00819.02
8.1.160.0040.00418.85
8.1.150.0040.00418.66
8.1.140.0000.00717.33
8.1.130.0050.00317.89
8.1.120.0000.00717.49
8.1.110.0040.00417.39
8.1.100.0040.00417.45
8.1.90.0030.00517.38
8.1.80.0000.00817.38
8.1.70.0070.00017.41
8.1.60.0000.00717.47
8.1.50.0040.00417.39
8.1.40.0040.00417.49
8.1.30.0080.00017.50
8.1.20.0030.00517.63
8.1.10.0040.00417.54
8.1.00.0000.00817.43
8.0.300.0000.00819.90
8.0.290.0090.00016.63
8.0.280.0070.00018.40
8.0.270.0080.00017.30
8.0.260.0040.00416.78
8.0.250.0000.00816.96
8.0.240.0030.00616.93
8.0.230.0030.00316.91
8.0.220.0030.00316.86
8.0.210.0040.00416.82
8.0.200.0070.00016.79
8.0.190.0000.00716.85
8.0.180.0000.00716.76
8.0.170.0030.00616.89
8.0.160.0050.00316.93
8.0.150.0060.00316.77
8.0.140.0020.00516.74
8.0.130.0000.00613.27
8.0.120.0040.00416.80
8.0.110.0040.00416.66
8.0.100.0050.00216.65
8.0.90.0030.00516.74
8.0.80.0060.00916.83
8.0.70.0070.00016.66
8.0.60.0050.00216.85
8.0.50.0060.00316.75
8.0.30.0120.00917.07
8.0.20.0100.00916.98
8.0.10.0000.00716.95
8.0.00.0110.01116.67
7.4.330.0030.00312.97
7.4.320.0000.00716.57
7.4.300.0030.00316.48
7.4.290.0000.00716.46
7.4.280.0040.00416.46
7.4.270.0000.00716.48
7.4.260.0050.00013.22
7.4.250.0070.00316.51
7.4.240.0050.00316.48
7.4.230.0030.00316.55
7.4.220.0120.00916.52
7.4.210.0090.00716.53
7.4.200.0070.00016.54
7.4.190.0030.00316.67
7.4.160.0120.00416.31
7.4.150.0110.00716.39
7.4.140.0100.00716.40
7.4.130.0090.01116.39
7.4.120.0070.01416.39
7.4.110.0100.01316.55
7.4.100.0030.01316.45
7.4.90.0090.01416.54
7.4.80.0060.01316.34
7.4.70.0070.01416.48
7.4.60.0110.01116.31
7.4.50.0000.00916.34
7.4.40.0070.00716.14
7.4.30.0140.00716.64
7.4.00.0100.00814.97
7.3.330.0070.00013.27
7.3.320.0050.00013.22
7.3.310.0040.00416.29
7.3.300.0070.00016.23
7.3.290.0130.00616.26
7.3.280.0050.01016.24
7.3.270.0110.00716.32
7.3.260.0120.00516.29
7.3.250.0110.01016.44
7.3.240.0100.00616.22
7.3.230.0030.01416.20
7.3.210.0090.00916.55
7.3.200.0140.00419.39
7.3.190.0130.00616.26
7.3.180.0060.00916.50
7.3.170.0070.01116.38
7.3.160.0060.00916.38
7.3.120.0100.00714.93
7.3.110.0070.01114.73
7.3.100.0110.00314.73
7.3.90.0030.00614.54
7.3.80.0030.00914.57
7.3.70.0070.00714.45
7.3.60.0000.01014.85
7.3.50.0100.00614.45
7.3.40.0000.00914.64
7.3.30.0030.01214.75
7.3.20.0080.00816.36
7.3.10.0090.00016.41
7.3.00.0000.01016.49
7.2.330.0090.00916.43
7.2.320.0120.00616.53
7.2.310.0140.00716.54
7.2.300.0060.01316.66
7.2.290.0160.00016.55
7.2.250.0070.01115.01
7.2.240.0070.01014.74
7.2.230.0060.00914.28
7.2.220.0040.01114.78
7.2.210.0030.00915.09
7.2.200.0060.00614.93
7.2.190.0090.00614.91
7.2.180.0000.01314.92
7.2.170.0050.00515.02
7.2.00.0000.01519.31
7.1.330.0030.01015.28
7.1.320.0040.00815.39
7.1.310.0040.00715.37
7.1.300.0030.00615.63
7.1.290.0030.01015.36
7.1.280.0050.00515.79
7.1.270.0090.00415.18
7.1.260.0070.00715.15
7.1.100.0070.01118.13
7.1.70.0060.00316.88
7.1.60.0030.02019.40
7.1.50.0100.01316.82
7.1.00.0070.05022.40
7.0.200.0040.00416.52
7.0.140.0000.07721.99
7.0.120.0030.07322.06
7.0.60.0100.03320.12
7.0.50.0030.05717.94
7.0.40.0100.03720.19
7.0.30.0370.07320.28
7.0.20.0200.06320.33
7.0.10.0200.05020.06
7.0.00.0200.03020.18
5.6.280.0100.08721.04
5.6.210.0000.05720.56
5.6.200.0100.05018.29
5.6.190.0100.08320.51
5.6.180.0370.05020.46
5.6.170.0270.03720.57
5.6.160.0070.06320.56
5.6.150.0100.07718.21
5.6.140.0000.06318.17
5.6.130.0030.04018.17
5.6.120.0030.06321.02
5.6.110.0070.08721.00
5.6.100.0030.08321.15
5.6.90.0000.06020.98
5.6.80.0100.07720.39
5.6.70.4230.04020.30
5.5.350.0300.08020.38
5.5.340.0100.06718.00
5.5.330.0100.07320.37
5.5.320.0200.04320.22
5.5.310.0230.05320.29
5.5.300.0070.03718.08
5.5.290.0070.08718.01
5.5.280.0070.07020.92
5.5.270.0100.05020.79
5.5.260.0070.05020.89
5.5.250.0070.08020.49
5.5.240.0030.08020.14
5.4.450.0030.04019.48
5.4.440.0070.06019.25
5.4.430.0000.05019.56
5.4.420.0030.04019.57
5.4.410.0100.08019.28
5.4.400.0130.03718.98
5.4.390.0100.06719.14
5.4.380.0070.03718.93
5.4.370.0070.08019.00
5.4.360.0000.04318.85
5.4.350.0030.05318.92
5.4.340.0070.07718.86
5.4.320.0000.04319.00
5.4.310.0070.06019.20
5.4.300.0070.03718.97
5.4.290.0000.04318.97
5.4.280.0000.05318.85
5.4.270.0070.05019.11
5.4.260.0070.08318.98
5.4.250.0000.06719.11
5.4.240.0070.05319.14
5.4.230.0030.05019.14
5.4.220.0070.07319.23
5.4.210.0100.07718.86
5.4.200.0170.05718.84
5.4.190.0030.06319.06
5.4.180.0030.04318.84
5.4.170.0030.06719.27
5.4.160.0000.05718.83
5.4.150.0070.03719.23
5.4.140.0030.06316.45
5.4.130.0100.04316.44
5.4.120.0030.05016.39
5.4.110.0070.04016.41
5.4.100.0070.06316.41
5.4.90.0070.03716.41
5.4.80.0070.06016.28
5.4.70.0030.06316.42
5.4.60.0000.04716.46
5.4.50.0030.07316.45
5.4.40.0030.05016.64
5.4.30.0070.03316.36
5.4.20.0070.03316.27
5.4.10.0030.07316.27
5.4.00.0070.05715.78
5.3.290.0030.04014.86
5.3.280.0130.07014.68
5.3.270.0100.08314.79
5.3.260.0030.05314.65
5.3.250.0000.04014.52
5.3.240.0030.04314.54
5.3.230.0070.03714.79
5.3.220.0030.03714.74
5.3.210.0100.06014.65
5.3.200.0030.05314.61
5.3.190.0030.07714.60
5.3.180.0030.07314.62
5.3.170.0100.04714.62
5.3.160.0030.08314.63
5.3.150.0030.06014.64
5.3.140.0100.04014.64
5.3.130.0000.05314.57
5.3.120.0000.04014.61
5.3.110.0100.03714.63
5.3.100.0070.03714.08
5.3.90.0030.05014.13
5.3.80.0030.04314.21
5.3.70.0100.07014.05
5.3.60.0070.03314.01
5.3.50.0100.03313.95
5.3.40.0030.04013.94
5.3.30.0000.04314.10
5.3.20.0030.05013.79
5.3.10.0070.03713.73
5.3.00.0000.03713.70
5.2.170.0000.06711.15
5.2.160.0070.02711.19
5.2.150.0030.04311.35
5.2.140.0000.03311.21
5.2.130.0000.03311.11
5.2.120.0070.02311.21
5.2.110.0000.03011.30
5.2.100.0030.03011.23
5.2.90.0030.06011.16
5.2.80.0070.04311.18
5.2.70.0030.04311.17
5.2.60.0070.02711.23
5.2.50.0030.03710.98
5.2.40.0000.03311.09
5.2.30.0030.03011.04
5.2.20.0000.06311.17
5.2.10.0000.06311.06
5.2.00.0000.03010.81
5.1.60.0100.05010.18
5.1.50.0030.03710.08
5.1.40.0100.0379.98
5.1.30.0100.05310.38
5.1.20.0000.05710.46
5.1.10.0070.05710.17
5.1.00.0070.03010.09
5.0.50.0030.0308.67
5.0.40.0000.0508.63
5.0.30.0000.0338.34
5.0.20.0070.0338.33
5.0.10.0070.0138.26
5.0.00.0030.0508.38
4.4.90.0000.0377.88
4.4.80.0000.0177.88
4.4.70.0000.0177.88
4.4.60.0000.0337.88
4.4.50.0000.0207.88
4.4.40.0000.0607.88
4.4.30.0000.0377.88
4.4.20.0030.0337.88
4.4.10.0030.0337.88
4.4.00.0030.0537.88
4.3.110.0030.0207.88
4.3.100.0000.0237.88
4.3.90.0000.0337.88
4.3.80.0030.0277.88
4.3.70.0000.0237.88
4.3.60.0070.0277.88
4.3.50.0000.0177.88
4.3.40.0000.0437.88
4.3.30.0000.0237.88
4.3.20.0030.0237.88
4.3.10.0000.0377.88
4.3.00.0070.0177.88

preferences:
44.22 ms | 401 KiB | 5 Q