3v4l.org

run code in 300+ PHP versions simultaneously
<?php class GetResponse { private $api_key; private $api_url = 'https://api.getresponse.com/v3'; private $timeout = 8; private $enterprise_domain = null; public $http_status; /** * Set api key and optionally API endpoint * @param $api_key * @param null $api_url */ public function __construct ($api_key, $api_url = null) { $this->api_key = $api_key; if ( !empty($api_url)) $this->api_url = $api_url; } /** * We can modify internal settings * @param $key * @param $value */ function __set($key, $value) { $this->{$key} = $value; } /** * get account details * * @return mixed */ public function accounts() { return $this->call('accounts'); } /** * @return mixed */ public function ping() { return $this->accounts(); } /** * Return all campaigns * @return mixed */ public function getCampaigns() { return $this->call('campaigns'); } /** * get single campaign * @param string $campaign_id retrieved using API * @return mixed */ public function getCampaign($campaign_id) { return $this->call('campaigns/' . $campaign_id); } /** * adding campaign * @param $params * @return mixed */ public function createCampaign($params) { return $this->call('campaigns', 'POST', $params); } /** * list all RSS newsletters * @return mixed */ public function getRSSNewsletters() { $this->call('rss-newsletters', 'GET', null); } /** * send one newsletter * * @param $params * @return mixed */ public function sendNewsletter($params) { return $this->call('newsletters', 'POST', $params); } /** * @param $params * @return mixed */ public function sendDraftNewsletter($params) { return $this->call('newsletters/send-draft', 'POST', $params); } /** * add single contact into your campaign * * @param $params * @return mixed */ public function addContact($params) { return $this->call('contacts', 'POST', $params); } /** * retrieving contact by id * * @param string $contact_id - contact id obtained by API * @return mixed */ public function getContact($contact_id) { return $this->call('contacts/' . $contact_id); } /** * search contacts * * @param $params * @return mixed */ public function searchContacts($params = null) { return $this->call('search-contacts/' . $this->setParams($params)); } /** * retrieve segment * * @param $id * @return mixed */ public function getContactsSearch($id) { return $this->call('search-contacts/' . $id); } /** * add contacts search * * @param $params * @return mixed */ public function addContactsSearch($params) { return $this->call('search-contacts/', 'POST', $params); } /** * add contacts search * * @param $id * @return mixed */ public function deleteContactsSearch($id) { return $this->call('search-contacts/' . $id, 'DELETE'); } /** * get contact activities * @param $contact_id */ public function getContactActivities($contact_id) { $this->call('contacts/' . $contact_id . '/activities'); } /** * retrieving contact by params * @param array $params * * @return mixed */ public function getContacts($params = array()) { return $this->call('contacts?' . $this->setParams($params)); } /** * updating any fields of your subscriber (without email of course) * @param $contact_id * @param array $params * * @return mixed */ public function updateContact($contact_id, $params = array()) { return $this->call('contacts/' . $contact_id, 'POST', $params); } /** * drop single user by ID * * @param string $contact_id - obtained by API * @return mixed */ public function deleteContact($contact_id) { return $this->call('contacts/' . $contact_id, 'DELETE'); } /** * retrieve account custom fields * @param array $params * * @return mixed */ public function getCustomFields($params = array()) { return $this->call('custom-fields?' . $this->setParams($params)); } /** * add custom field * * @param $params * @return mixed */ public function setCustomField($params) { return $this->call('custom-fields', 'POST', $params); } /** * retrieve single custom field * * @param string $cs_id obtained by API * @return mixed */ public function getCustomField($custom_id) { return $this->call('custom-fields/' . $custom_id, 'GET'); } /** * retrieving billing information * * @return mixed */ public function getBillingInfo() { return $this->call('accounts/billing'); } /** * get single web form * * @param int $w_id * @return mixed */ public function getWebForm($w_id) { return $this->call('webforms/' . $w_id); } /** * retrieve all webforms * @param array $params * * @return mixed */ public function getWebForms($params = array()) { return $this->call('webforms?' . $this->setParams($params)); } /** * get single form * * @param int $form_id * @return mixed */ public function getForm($form_id) { return $this->call('forms/' . $form_id); } /** * retrieve all forms * @param array $params * * @return mixed */ public function getForms($params = array()) { return $this->call('forms?' . $this->setParams($params)); } /** * Curl run request * * @param null $api_method * @param string $http_method * @param array $params * @return mixed * @throws Exception */ private function call($api_method = null, $http_method = 'GET', $params = array()) { if (empty($api_method)) { return (object)array( 'httpStatus' => '400', 'code' => '1010', 'codeDescription' => 'Error in external resources', 'message' => 'Invalid api method' ); } $params = json_encode($params); $url = $this->api_url . '/' . $api_method; $options = array( CURLOPT_URL => $url, CURLOPT_ENCODING => 'gzip,deflate', CURLOPT_FRESH_CONNECT => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_TIMEOUT => $this->timeout, CURLOPT_HEADER => false, CURLOPT_USERAGENT => 'PHP GetResponse client 0.0.2', CURLOPT_HTTPHEADER => array('X-Auth-Token: api-key ' . $this->api_key, 'Content-Type: application/json') ); if ( !empty($this->enterprise_domain) ) { $options[CURLOPT_HTTPHEADER][] = 'X-Domain: ' . $this->enterprise_domain; } if ($http_method == 'POST') { $options[CURLOPT_POST] = 1; $options[CURLOPT_POSTFIELDS] = $params; } else if ($http_method == 'DELETE') { $options[CURLOPT_CUSTOMREQUEST] = 'DELETE'; } $curl = curl_init(); curl_setopt_array($curl, $options); $response = json_decode(curl_exec($curl)); $this->http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); return (object)$response; } /** * @param array $params * * @return string */ private function setParams($params = array()) { $result = array(); if (is_array($params)) { foreach ($params as $key => $value) { $result[$key] = $value; } } return http_build_query($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)
8.3.40.0160.00318.54
8.3.30.0120.00618.73
8.3.20.0070.00020.39
8.3.10.0040.00423.61
8.3.00.0000.00823.53
8.2.170.0150.00622.96
8.2.160.0140.00022.31
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0090.00017.38
8.2.110.0070.00421.02
8.2.100.0080.00417.38
8.2.90.0000.00819.09
8.2.80.0000.00817.97
8.2.70.0050.00517.50
8.2.60.0050.00317.93
8.2.50.0090.00018.07
8.2.40.0030.00619.31
8.2.30.0060.00618.20
8.2.20.0050.00217.57
8.2.10.0040.00418.05
8.2.00.0040.00418.01
8.1.270.0050.00320.27
8.1.260.0080.00026.35
8.1.250.0000.00928.09
8.1.240.0090.00022.31
8.1.230.0090.00317.64
8.1.220.0030.00517.78
8.1.210.0000.00818.77
8.1.200.0070.00317.13
8.1.190.0050.00317.10
8.1.180.0000.00818.10
8.1.170.0050.00318.62
8.1.160.0040.00422.02
8.1.150.0000.00718.83
8.1.140.0030.00617.30
8.1.130.0030.00317.65
8.1.120.0040.00417.34
8.1.110.0000.00717.42
8.1.100.0060.00317.32
8.1.90.0000.00817.38
8.1.80.0000.00717.30
8.1.70.0000.00817.34
8.1.60.0040.00417.50
8.1.50.0000.00917.39
8.1.40.0030.00517.32
8.1.30.0070.00317.48
8.1.20.0080.00017.53
8.1.10.0000.00817.43
8.1.00.0040.00417.41
8.0.300.0080.00018.77
8.0.290.0000.00716.75
8.0.280.0000.00718.36
8.0.270.0030.00317.08
8.0.260.0030.00317.08
8.0.250.0040.00416.79
8.0.240.0000.00716.84
8.0.230.0000.00716.86
8.0.220.0030.00516.82
8.0.210.0050.00316.74
8.0.200.0070.00016.94
8.0.190.0000.00716.79
8.0.180.0000.00716.88
8.0.170.0090.00016.92
8.0.160.0000.00716.87
8.0.150.0030.00316.84
8.0.140.0050.00316.82
8.0.130.0000.00613.17
8.0.120.0030.00516.69
8.0.110.0050.00216.75
8.0.100.0040.00416.95
8.0.90.0070.00016.91
8.0.80.0110.00616.80
8.0.70.0050.00216.93
8.0.60.0040.00416.84
8.0.50.0090.00016.76
8.0.30.0090.00917.12
8.0.20.0090.00917.40
8.0.10.0000.00817.00
8.0.00.0080.01016.72
7.4.330.0050.00215.08
7.4.320.0030.00316.54
7.4.300.0000.00616.54
7.4.290.0070.00016.46
7.4.280.0030.00516.55
7.4.270.0040.00416.45
7.4.260.0000.00816.51
7.4.250.0000.00716.49
7.4.240.0020.00516.57
7.4.230.0030.00316.25
7.4.220.0070.01416.45
7.4.210.0040.01116.61
7.4.200.0050.00316.35
7.4.160.0000.01516.30
7.4.150.0040.01417.40
7.4.140.0110.01117.86
7.4.130.0070.01216.43
7.4.120.0100.00716.46
7.4.110.0110.00716.34
7.4.100.0110.00916.56
7.4.90.0100.01316.55
7.4.80.0120.00619.39
7.4.70.0110.00616.52
7.4.60.0140.00316.35
7.4.50.0070.00416.44
7.4.40.0080.00816.48
7.4.30.0170.00916.42
7.4.10.0160.00316.30
7.4.00.0080.00915.40
7.3.330.0040.00413.12
7.3.320.0050.00013.23
7.3.310.0030.00316.26
7.3.300.0000.00716.11
7.3.290.0060.01216.25
7.3.280.0080.01116.28
7.3.270.0100.01117.40
7.3.260.0120.00616.18
7.3.250.0120.00416.43
7.3.240.0220.00316.27
7.3.230.0060.01716.39
7.3.210.0120.00616.18
7.3.200.0030.01316.39
7.3.190.0090.00616.55
7.3.180.0130.00316.10
7.3.170.0030.01916.28
7.3.160.0120.00916.18
7.3.130.0070.01016.26
7.3.120.0050.01015.32
7.3.110.0070.00915.29
7.3.100.0060.00715.36
7.3.90.0060.00815.38
7.3.80.0070.00715.42
7.3.70.0040.01115.16
7.3.60.0060.00715.28
7.3.50.0040.01015.22
7.3.40.0030.00815.24
7.3.30.0100.00515.25
7.3.20.0030.01216.98
7.3.10.0080.00616.72
7.3.00.0070.00716.74
7.2.330.0120.00616.33
7.2.320.0070.01716.30
7.2.310.0090.01216.30
7.2.300.0110.00716.31
7.2.290.0100.00716.51
7.2.260.0030.01616.42
7.2.250.0080.01115.54
7.2.240.0120.00515.28
7.2.230.0070.01015.48
7.2.220.0050.00815.29
7.2.210.0060.00815.42
7.2.200.0080.00615.39
7.2.190.0060.01015.34
7.2.180.0070.00715.27
7.2.170.0050.01215.27
7.2.160.0050.01315.77
7.2.150.0050.01117.26
7.2.140.0070.00717.54
7.2.130.0060.01317.12
7.2.120.0110.01117.10
7.2.110.0090.00817.10
7.2.100.0080.01217.13
7.2.90.0120.00517.06
7.2.80.0140.00917.02
7.2.70.0080.00917.10
7.2.60.0020.01217.13
7.2.50.0100.00717.07
7.2.40.0080.00817.06
7.2.30.0090.00817.04
7.2.20.0100.00417.04
7.2.10.0100.00717.13
7.2.00.0080.00817.58
7.1.330.0060.00916.12
7.1.320.0060.00616.19
7.1.310.0070.00816.06
7.1.300.0070.00616.18
7.1.290.0020.00916.17
7.1.280.0040.01016.16
7.1.270.0040.00916.14
7.1.260.0060.00616.11
7.1.250.0110.00716.09
7.1.240.0000.01217.16
7.1.230.0080.00417.09
7.1.220.0100.00717.06
7.1.210.0030.01616.92
7.1.200.0100.00617.18
7.1.190.0080.00417.11
7.1.180.0000.01217.00
7.1.170.0080.00616.97
7.1.160.0060.00616.95
7.1.150.0030.01117.04
7.1.140.0100.00317.32
7.1.130.0060.00617.00
7.1.120.0070.00717.21
7.1.110.0080.00317.16
7.1.100.0020.01417.38
7.1.90.0060.00916.90
7.1.80.0040.00817.04
7.1.70.0080.00316.89
7.1.60.0040.01418.09
7.1.50.0050.01117.01
7.1.40.0030.01217.36
7.1.30.0070.00317.23
7.1.20.0070.00717.18
7.1.10.0000.01517.15
7.1.00.0020.04619.83
7.0.330.0040.01116.77
7.0.320.0060.01016.97
7.0.310.0080.00316.79
7.0.300.0030.00616.97
7.0.290.0000.01016.80
7.0.280.0030.01016.83
7.0.270.0080.00416.65
7.0.260.0030.00816.66
7.0.250.0140.00316.68
7.0.240.0030.00716.96
7.0.230.0130.00016.82
7.0.220.0030.00616.80
7.0.210.0090.00016.73
7.0.200.0030.00816.82
7.0.190.0030.00716.82
7.0.180.0070.00716.98
7.0.170.0040.00716.90
7.0.160.0030.00616.81
7.0.150.0090.00316.95
7.0.140.0030.00616.74
7.0.130.0070.01016.71
7.0.120.0060.00617.00
7.0.110.0100.00716.79
7.0.100.0040.00716.76
7.0.90.0320.02718.44
7.0.80.0100.04518.34
7.0.70.0300.04318.45
7.0.60.0340.02418.40
7.0.50.0330.03718.58
7.0.40.0090.04617.27
7.0.30.0060.02817.52
7.0.20.0090.02517.47
7.0.10.0010.04817.52
7.0.00.0080.04517.45
5.6.400.0070.00715.87
5.6.390.0030.01015.89
5.6.380.0070.01115.58
5.6.370.0060.00615.86
5.6.360.0100.00716.00
5.6.350.0030.01215.59
5.6.340.0000.01015.81
5.6.330.0030.01015.64
5.6.320.0000.01715.98
5.6.310.0130.00015.45
5.6.300.0030.01015.63
5.6.290.0110.00415.58
5.6.280.0060.01818.43
5.6.270.0030.00615.70
5.6.260.0040.00815.85
5.6.250.0070.01015.70
5.6.240.0150.03918.13
5.6.230.0110.03818.13
5.6.220.0100.02318.14
5.6.210.0050.03218.25
5.6.200.0050.04818.44
5.6.190.0100.04618.32
5.6.180.0080.04218.31
5.6.170.0100.04518.35
5.6.160.0060.04218.41
5.6.150.0100.02718.34
5.6.140.0050.02818.54
5.6.130.0080.03018.46
5.6.120.0120.04218.46
5.6.110.0080.03518.48
5.6.100.0050.04718.46
5.6.90.0070.02718.33
5.6.80.0050.04818.15
5.6.70.0050.03018.03
5.6.60.0090.03618.21
5.6.50.0140.03718.06
5.6.40.0050.04118.03
5.6.30.0010.03618.14
5.6.20.0070.02918.10
5.6.10.0050.04618.19
5.6.00.0130.02218.00
5.5.380.0020.05018.08
5.5.370.0070.03018.05
5.5.360.0050.03718.06
5.5.350.0040.04518.03
5.5.340.0100.03318.44
5.5.330.0000.03418.34
5.5.320.0060.04718.29
5.5.310.0050.04318.14
5.5.300.0130.02118.23
5.5.290.0070.04218.15
5.5.280.0070.04718.35
5.5.270.0020.02918.14
5.5.260.0090.02618.24
5.5.250.0080.02618.10
5.5.240.0090.04117.97
5.5.230.0070.04318.00
5.5.220.0100.02517.87
5.5.210.0030.02517.94
5.5.200.0060.03617.88
5.5.190.0050.03317.86
5.5.180.0030.02817.91
5.5.170.0030.00615.57
5.5.160.0050.03317.96
5.5.150.0130.03517.80
5.5.140.0040.05017.99
5.5.130.0100.03517.74
5.5.120.0100.04017.97
5.5.110.0050.04617.86
5.5.100.0100.03317.67
5.5.90.0070.03317.92
5.5.80.0070.02817.83
5.5.70.0070.02417.88
5.5.60.0100.04217.90
5.5.50.0080.02517.74
5.5.40.0070.04017.86
5.5.30.0080.02617.78
5.5.20.0130.03817.85
5.5.10.0020.02717.86
5.5.00.0050.04717.87
5.4.450.0060.03916.70
5.4.440.0080.02516.61
5.4.430.0080.04016.73
5.4.420.0000.04816.63
5.4.410.0050.03816.61
5.4.400.0080.04316.61
5.4.390.0050.03216.61
5.4.380.0020.03016.61
5.4.370.0020.02716.44
5.4.360.0020.02516.51
5.4.350.0040.03716.42
5.4.340.0070.02716.61
5.4.330.0080.00313.98
5.4.320.0030.02516.61
5.4.310.0080.04116.56
5.4.300.0030.02716.44
5.4.290.0080.03016.43
5.4.280.0050.03716.42
5.4.270.0080.02916.56
5.4.260.0030.02816.44
5.4.250.0090.03816.50
5.4.240.0120.02716.46
5.4.230.0030.02216.42
5.4.220.0050.04216.41
5.4.210.0060.03916.51
5.4.200.0100.02516.55
5.4.190.0030.03516.59
5.4.180.0020.04516.41
5.4.170.0100.03716.55
5.4.160.0050.03716.54
5.4.150.0070.02516.55
5.4.140.0100.03515.20
5.4.130.0090.02015.25
5.4.120.0050.04015.22
5.4.110.0070.03715.21
5.4.100.0050.02915.28
5.4.90.0030.03615.27
5.4.80.0060.04315.19
5.4.70.0030.03215.21
5.4.60.0050.03615.17
5.4.50.0030.02615.24
5.4.40.0020.04215.25
5.4.30.0070.03015.18
5.4.20.0080.02815.20
5.4.10.0070.03715.18
5.4.00.0070.03814.95

preferences:
52.75 ms | 400 KiB | 5 Q