3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SmsGateway { static $baseUrl = "https://smsgateway.me"; function __construct($email,$password) { $this->email = $email; $this->password = $password; } function createContact ($name,$number) { return $this->makeRequest('/api/v3/contacts/create','POST',['name' => $name, 'number' => $number]); } function getContacts ($page=1) { return $this->makeRequest('/api/v3/contacts','GET',['page' => $page]); } function getContact ($id) { return $this->makeRequest('/api/v3/contacts/view/'.$id,'GET'); } function getDevices ($page=1) { return $this->makeRequest('/api/v3/devices','GET',['page' => $page]); } function getDevice ($id) { return $this->makeRequest('/api/v3/devices/view/'.$id,'GET'); } function getMessages($page=1) { return $this->makeRequest('/api/v3/messages','GET',['page' => $page]); } function getMessage($id) { return $this->makeRequest('/api/v3/messages/view/'.$id,'GET'); } function sendMessageToNumber($to, $message, $device, $options=[]) { $query = array_merge(['number'=>$to, 'message'=>$message, 'device' => $device], $options); return $this->makeRequest('/api/v3/messages/send','POST',$query); } function sendMessageToManyNumbers ($to, $message, $device, $options=[]) { $query = array_merge(['number'=>$to, 'message'=>$message, 'device' => $device], $options); return $this->makeRequest('/api/v3/messages/send','POST', $query); } function sendMessageToContact ($to, $message, $device, $options=[]) { $query = array_merge(['contact'=>$to, 'message'=>$message, 'device' => $device], $options); return $this->makeRequest('/api/v3/messages/send','POST', $query); } function sendMessageToManyContacts ($to, $message, $device, $options=[]) { $query = array_merge(['contact'=>$to, 'message'=>$message, 'device' => $device], $options); return $this->makeRequest('/api/v3/messages/send','POST', $query); } function sendManyMessages ($data) { $query['data'] = $data; return $this->makeRequest('/api/v3/messages/send','POST', $query); } private function makeRequest ($url, $method, $fields=[]) { $fields['email'] = $this->email; $fields['password'] = $this->password; $url = smsGateway::$baseUrl.$url; $fieldsString = http_build_query($fields); $ch = curl_init(); if($method == 'POST') { curl_setopt($ch,CURLOPT_POST, count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS, $fieldsString); } else { $url .= '?'.$fieldsString; } curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $info = curl_getinfo($ch); $result = curl_exec ($ch); print_r($info['request_header']); $return['response'] = json_decode($result,true); if($return['response'] == false) $return['response'] = $result; $return['status'] = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close ($ch); return $return; } } $smsGateway = new SmsGateway('guritsanu.andrei@gmail.com', 'SMSGatewayVoldam'); $deviceID = 27389; $number = '0037379850506'; $message = 'Hello World!'; //Please note options is no required and can be left out $result = $smsGateway->sendMessageToNumber($number, $message, $deviceID); ?>

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.4.20.0140.00717.71
8.4.10.0030.00619.66
8.3.140.0030.00616.86
8.3.130.0150.00017.04
8.3.120.0070.00319.05
8.3.110.0120.00316.89
8.3.100.0060.00324.06
8.3.90.0050.00326.77
8.3.80.0030.00617.97
8.3.70.0170.00316.88
8.3.60.0120.00917.00
8.3.50.0180.00322.04
8.3.40.0060.01318.97
8.3.30.0130.01018.98
8.3.20.0080.00021.08
8.3.10.0040.00421.71
8.3.00.0000.00820.71
8.2.260.0190.00016.70
8.2.250.0050.00316.86
8.2.240.0110.00717.18
8.2.230.0060.00320.94
8.2.220.0000.00837.54
8.2.210.0030.00526.77
8.2.200.0060.00316.63
8.2.190.0100.01016.96
8.2.180.0090.00917.00
8.2.170.0140.00022.96
8.2.160.0100.01020.96
8.2.150.0000.00725.66
8.2.140.0110.00424.66
8.2.130.0070.00022.25
8.2.120.0040.00426.35
8.2.110.0100.00021.12
8.2.100.0080.00417.91
8.2.90.0040.00417.91
8.2.80.0100.00022.26
8.2.70.0040.00417.75
8.2.60.0000.00817.75
8.2.50.0040.00417.61
8.2.40.0050.00322.28
8.2.30.0000.00819.25
8.2.20.0000.00817.82
8.2.10.0040.00418.23
8.2.00.0040.00418.16
8.1.310.0070.01116.63
8.1.300.0090.00918.32
8.1.290.0060.00330.84
8.1.280.0110.00625.92
8.1.270.0030.00623.79
8.1.260.0030.00528.09
8.1.250.0070.00028.09
8.1.240.0060.00322.05
8.1.230.0110.00021.94
8.1.220.0000.01017.79
8.1.210.0030.00618.77
8.1.200.0040.00417.47
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0080.00018.76
8.1.160.0040.00422.21
8.1.150.0060.00318.93
8.1.140.0000.00719.63
8.1.130.0030.00317.77
8.1.120.0060.00317.60
8.1.110.0060.00317.43
8.1.100.0030.00617.44
8.1.90.0060.00317.45
8.1.80.0060.00317.59
8.1.70.0030.00317.47
8.1.60.0000.01017.66
8.1.50.0040.00417.59
8.1.40.0040.00417.46
8.1.30.0040.00417.75
8.1.20.0000.00817.77
8.1.10.0070.00317.68
8.1.00.0000.00817.42
8.0.300.0050.00320.07
8.0.290.0000.00716.88
8.0.280.0070.00018.57
8.0.270.0040.00417.23
8.0.260.0000.00617.32
8.0.250.0000.00817.05
8.0.240.0000.00717.08
8.0.230.0000.00716.94
8.0.220.0000.00716.90
8.0.210.0070.00016.91
8.0.200.0050.00317.00
8.0.190.0070.00017.03
8.0.180.0040.00417.07
8.0.170.0080.00016.92
8.0.160.0070.00016.99
8.0.150.0020.00516.93
8.0.140.0040.00716.96
8.0.130.0030.00313.41
8.0.120.0040.00416.89
8.0.110.0000.00817.02
8.0.100.0000.00717.00
8.0.90.0000.00716.93
8.0.80.0060.00917.06
8.0.70.0000.00816.96
8.0.60.0040.00416.83
8.0.50.0040.00417.13
8.0.30.0090.00717.02
8.0.20.0110.01117.40
8.0.10.0030.00516.96
8.0.00.0100.00716.59
7.4.330.0050.00015.19
7.4.320.0000.00716.48
7.4.300.0000.00716.66
7.4.290.0030.00316.52
7.4.280.0050.00316.61
7.4.270.0030.00316.56
7.4.260.0000.00816.54
7.4.250.0040.00416.54
7.4.240.0000.00716.69
7.4.230.0080.00016.37
7.4.220.0030.01216.73
7.4.210.0220.00016.66
7.4.200.0070.00016.55
7.4.160.0080.00816.56
7.4.150.0090.01017.40
7.4.140.0100.00717.86
7.4.130.0110.00916.66
7.4.120.0070.01316.74
7.4.110.0060.01616.48
7.4.100.0130.00616.67
7.4.90.0070.01116.45
7.4.80.0090.01319.39
7.4.70.0080.00816.59
7.4.60.0090.01316.64
7.4.50.0030.01016.40
7.4.40.0160.00316.42
7.4.30.0070.01016.52
7.4.00.0070.00715.08
7.3.330.0030.00313.56
7.3.320.0000.00613.48
7.3.310.0000.00916.34
7.3.300.0030.00316.50
7.3.290.0090.00716.49
7.3.280.0110.00616.46
7.3.270.0160.00717.40
7.3.260.0120.00916.55
7.3.250.0080.00916.49
7.3.240.0070.01016.70
7.3.230.0100.00716.49
7.3.210.0160.00716.48
7.3.200.0030.01316.40
7.3.190.0070.01016.65
7.3.180.0100.00716.70
7.3.170.0080.01216.53
7.3.160.0100.01116.61
7.3.10.0000.01416.75
7.3.00.0000.01316.44
7.2.330.0120.00616.38
7.2.320.0060.01216.80
7.2.310.0100.00716.68
7.2.300.0040.01416.64
7.2.290.0100.00716.80
7.2.130.0080.00616.89
7.2.120.0040.01116.54
7.2.110.0100.00016.41
7.2.100.0000.00916.83
7.2.90.0090.00316.89
7.2.80.0060.00316.76
7.2.70.0030.00917.15
7.2.60.0030.01016.91
7.2.50.0100.00016.88
7.2.40.0060.00616.95
7.2.30.0000.01516.65
7.2.20.0080.00316.97
7.2.10.0100.00616.88
7.2.00.0000.01516.69
7.1.250.0040.00715.84
7.1.200.0060.00915.75
7.1.70.0000.01016.88
7.1.60.0070.01719.81
7.1.50.0110.01517.12
7.1.00.0030.07722.30
7.0.200.0630.00614.83
7.0.100.0300.05720.05
7.0.90.0100.06020.11
7.0.80.0630.04720.09
7.0.70.0100.06320.10
7.0.60.0130.06020.01
7.0.50.0330.05720.49
7.0.40.0100.06320.39
7.0.30.0170.06720.44
7.0.20.0130.06720.45
7.0.10.0300.04320.42
7.0.00.0100.06720.38
5.6.250.0100.07720.89
5.6.240.0100.06020.80
5.6.230.0070.06720.64
5.6.220.0200.05720.66
5.6.210.0100.05720.79
5.6.200.0170.05721.14
5.6.190.0130.05721.14
5.6.180.0000.06721.07
5.6.170.0200.05721.10
5.6.160.0230.05021.22
5.6.150.0130.07021.18
5.6.140.0270.04321.12
5.6.130.0130.05721.14
5.6.120.0130.05721.23
5.6.110.0100.05721.11
5.6.100.0130.06321.10
5.6.90.0100.08021.11
5.6.80.0130.05720.44
5.6.70.0100.06020.59
5.6.60.0130.05020.61
5.6.50.0130.05020.63
5.6.40.0130.05320.42
5.6.30.0270.04320.50
5.6.20.0170.06020.47
5.6.10.0100.05720.48
5.6.00.0070.06320.50

preferences:
21.22 ms | 403 KiB | 5 Q