3v4l.org

run code in 300+ PHP versions simultaneously
<?php //////============================== //*********** echo "what now"; class SendSMSclass { //input parameters --------------------- var $username; //your username var $password; //your password var $sender; //sender text var $message; //message text var $flash; //Is flash message (1 or 0) var $inputgsmnumbers = array(); //destination gsm numbers var $type; //msg type ("bookmark" - for wap push, "longSMS" for text messages only) var $bookmark; //wap url (example: www.google.com) //-------------------------------------- var $host; var $path; var $XMLgsmnumbers; var $xmldata; var $request_data; var $response; function SendSMS($username, $password, $sender, $message, $flash, $inputgsmnumbers, $type, $bookmark) { $this->username = $username; $this->password = $password; $this->sender = htmlspecialchars($sender, ENT_QUOTES); $this->message = htmlspecialchars($message, ENT_QUOTES); $this->flash = $flash; $this->inputgsmnumbers = $inputgsmnumbers; $this->type = $type; $this->bookmark = $bookmark; $this->host = "api2.infobip.com"; $this->path = "/api/sendsms/xml"; $this->convertGSMnumberstoXML(); $this->prepareXMLdata(); $this->response = $this->doPost($this->path,$this->request_data,$this->host); return $this->response; } function convertGSMnumberstoXML() { $gsmcount = count($this->inputgsmnumbers); #counts gsm numbers for ( $i = 0; $i < $gsmcount; $i++ ) { $this->XMLgsmnumbers .= "<gsm>" . $this->inputgsmnumbers[$i] . "</gsm>"; } } function prepareXMLdata() { $this->xmldata = "<SMS><authentification><username>" . $this->username . "</username><password>" . $this->password . "</password></authentification><message><sender>" . $this->sender . "</sender><text>" . $this->message . "</text><flash>" . $this->flash . "</flash><type>" . $this->type . "</type><bookmark>" . $this->bookmark . "</bookmark></message><recipients>" . $this->XMLgsmnumbers . "</recipients></SMS>"; $this->request_data = 'XML=' . $this->xmldata; } function doPost($uri,$postdata,$host){ $da = fsockopen($host, 80, $errno, $errstr); if (!$da) { return "$errstr ($errno)"; } else { $salida ="POST $uri HTTP/1.1\r\n"; $salida.="Host: $host\r\n"; $salida.="User-Agent: PHP Script\r\n"; $salida.="Content-Type: text/xml\r\n"; $salida.="Content-Length: ".strlen($postdata)."\r\n"; $salida.="Connection: close\r\n\r\n"; $salida.=$postdata; fwrite($da, $salida); while (!feof($da)) $response.=fgets($da, 128); $response=split("\r\n\r\n",$response); $header=$response[0]; $responsecontent=$response[1]; if(!(strpos($header,"Transfer-Encoding: chunked")===false)){ $aux=split("\r\n",$responsecontent); for($i=0;$i<count($aux);$i++) if($i==0 || ($i%2==0)) $aux[$i]=""; $responsecontent=implode("",$aux); }//if return chop($responsecontent); }//else } } // *************** //$mygsm= $_SESSION['gsm']; //$myprovider = $_SESSION['provider'] ; //$myproviderpassword = $_SESSION['providerpassword'] ; //$mygsmchallenge= $_SESSION['gsmchallenge'] ; $mygsm= "254720219320" ; $myprovider = "mitambo"; $myprovider = "peter123"; $mygsmchallenge= "hola" ; $gsm = array(); $gsm[0] = $mygsm ; $username =$myprovider ; $password =$myproviderpassword ; $sender = "Psq"; $isflash = 0; $type ="longSMS" ; $bookmark = "what mark"; $messagetext = "psq: Write GSM code ".$mygsmchallenge." in your computer and click log in" ; // Note: replace sign "+" with "%2b" for sender and message text or it will be replaced with empty space $sender = str_replace("+","%2b",$sender); $messagetext = str_replace("+","%2b",$messagetext); $SENDSMS = new SendSMSclass(); $response = $SENDSMS->SendSMS($username,$password,$sender,$messagetext,$isflash, $gsm, $type, $bookmark); //IsFlash must be 0 or 1 //echo $response; ?>

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.0120.00418.68
8.3.50.0080.01121.34
8.3.40.0090.00619.17
8.3.30.0140.00020.73
8.3.20.0000.00720.58
8.3.10.0000.00821.47
8.3.00.0000.00822.68
8.2.180.0060.01316.88
8.2.170.0080.00822.96
8.2.160.0070.00722.41
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00620.98
8.2.110.0040.00722.38
8.2.100.0040.00719.82
8.2.90.0000.00819.48
8.2.80.0080.00018.00
8.2.70.0030.00617.88
8.2.60.0080.00418.05
8.2.50.0000.00818.07
8.2.40.0060.00318.46
8.2.30.0060.00319.65
8.2.20.0000.00817.98
8.2.10.0000.00818.17
8.2.00.0000.00818.10
8.1.270.0080.00023.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.79
8.1.230.0040.00817.83
8.1.220.0080.00018.04
8.1.210.0060.00318.77
8.1.200.0030.00717.61
8.1.190.0000.00817.91
8.1.180.0030.00518.10
8.1.170.0030.00518.89
8.1.160.0040.00419.25
8.1.150.0030.00518.89
8.1.140.0040.00417.75
8.1.130.0060.00318.04
8.1.120.0040.00417.63
8.1.110.0030.00617.61
8.1.100.0000.00817.62
8.1.90.0070.00017.65
8.1.80.0040.00417.65
8.1.70.0040.00417.66
8.1.60.0000.00917.73
8.1.50.0040.00417.70
8.1.40.0030.00617.69
8.1.30.0080.00017.74
8.1.20.0000.00817.86
8.1.10.0060.00317.84
8.1.00.0080.00017.54
8.0.300.0040.00418.77
8.0.290.0000.00817.13
8.0.280.0050.00218.61
8.0.270.0040.00417.49
8.0.260.0000.00717.20
8.0.250.0050.00317.30
8.0.240.0030.00617.33
8.0.230.0030.00517.20
8.0.220.0000.00717.07
8.0.210.0040.00417.13
8.0.200.0030.00317.16
8.0.190.0040.00417.28
8.0.180.0030.00617.28
8.0.170.0050.00317.10
8.0.160.0000.00917.01
8.0.150.0040.00416.97
8.0.140.0070.00017.05
8.0.130.0000.00613.59
8.0.120.0060.00317.15
8.0.110.0040.00417.27
8.0.100.0040.00417.24
8.0.90.0080.00017.28
8.0.80.0030.01417.18
8.0.70.0040.00417.10
8.0.60.0040.00417.29
8.0.50.0000.00817.20
8.0.30.0050.01517.40
8.0.20.0140.00917.43
8.0.10.0050.00317.42
8.0.00.0080.01417.23
7.4.330.0000.00517.16
7.4.320.0000.00716.60
7.4.300.0070.00016.77
7.4.290.0030.00316.78
7.4.280.0040.00416.70
7.4.270.0080.00016.77
7.4.260.0060.00013.60
7.4.250.0030.00616.84
7.4.240.0040.00416.73
7.4.230.0030.00516.61
7.4.220.0120.00816.91
7.4.210.0110.00516.88
7.4.200.0000.00716.91
7.4.190.0040.00417.05
7.4.160.0040.01316.76
7.4.150.0110.01517.40
7.4.140.0110.00817.86
7.4.130.0120.00716.80
7.4.120.0090.01116.96
7.4.110.0120.00616.62
7.4.100.0070.01116.82
7.4.90.0090.00916.82
7.4.80.0110.00719.39
7.4.70.0030.01316.83
7.4.60.0070.01316.73
7.4.50.0000.00916.60
7.4.40.0070.01022.77
7.4.30.0070.01516.74
7.4.00.0110.00715.04
7.3.330.0030.00313.45
7.3.320.0040.00413.67
7.3.310.0000.00816.63
7.3.300.0040.00316.68
7.3.290.0130.00316.71
7.3.280.0090.00916.71
7.3.270.0120.00617.40
7.3.260.0100.00918.24
7.3.250.0090.01216.92
7.3.240.0060.01216.75
7.3.230.0120.00616.67
7.3.210.0120.00816.72
7.3.200.0170.00519.39
7.3.190.0140.00416.95
7.3.180.0140.00416.76
7.3.170.0090.01316.79
7.3.160.0170.00016.85
7.3.120.0040.01415.08
7.3.110.0060.00915.19
7.3.100.0060.00615.24
7.3.90.0070.00715.16
7.3.80.0100.00015.02
7.3.70.0000.01515.09
7.3.60.0030.00715.25
7.3.50.0040.00815.27
7.3.40.0080.00415.00
7.3.30.0110.00415.23
7.3.20.0000.01416.79
7.3.10.0030.00916.89
7.3.00.0090.00616.71
7.2.330.0180.00317.13
7.2.320.0100.01116.88
7.2.310.0120.01817.22
7.2.300.0120.00617.11
7.2.290.0070.01317.21
7.2.240.0060.00615.29
7.2.230.0080.00815.38
7.2.220.0110.00015.30
7.2.210.0060.01015.27
7.2.200.0070.00715.48
7.2.190.0110.00415.50
7.2.180.0040.01515.24
7.2.170.0160.00015.21
7.2.160.0000.01215.55
7.2.150.0090.00617.16
7.2.140.0110.00417.25
7.2.130.0110.00317.24
7.2.120.0060.00917.23
7.2.110.0000.01417.14
7.2.100.0060.01217.27
7.2.90.0090.00617.29
7.2.80.0000.01817.05
7.2.70.0070.01117.42
7.2.60.0050.01017.11
7.2.50.0100.00316.77
7.2.40.0090.00617.21
7.2.30.0060.00617.09
7.2.20.0090.00917.02
7.2.10.0090.00917.23
7.2.00.0070.01017.19
7.1.330.0030.01316.25
7.1.320.0070.01116.05
7.1.310.0000.01716.03
7.1.300.0000.01515.89
7.1.290.0080.00815.78
7.1.280.0000.01516.02
7.1.270.0060.00916.15
7.1.260.0100.00716.23
7.1.250.0090.00616.13
7.1.200.0080.00616.17
7.1.70.0060.00917.54
7.1.60.0140.01119.17
7.1.50.0070.01017.50
7.1.00.0030.04722.64
7.0.200.0030.00917.01
7.0.140.0070.06322.39
7.0.100.0030.08720.32
7.0.90.0030.07720.66
7.0.80.0100.08320.27
7.0.70.0100.06320.44
7.0.60.0130.06020.43
7.0.50.0070.05020.82
7.0.40.0070.08020.38
7.0.30.0100.08320.43
7.0.20.0070.04720.54
7.0.10.0030.05320.37
7.0.00.0100.07320.55
5.6.280.0030.07021.44
5.6.250.0100.05721.14
5.6.240.0130.07020.99
5.6.230.0030.08320.98
5.6.220.0030.08020.97
5.6.210.0070.08021.07
5.6.200.0070.08021.36
5.6.190.0100.05321.39
5.6.180.0030.09021.42
5.6.170.0070.07721.43
5.6.160.0200.06721.26
5.6.150.0070.09721.41
5.6.140.0030.08321.48
5.6.130.0030.07721.53
5.6.120.0100.07321.41
5.6.110.0130.07721.54
5.6.100.0070.09021.50
5.6.90.0130.08021.60
5.6.80.0100.05320.66
5.6.70.0100.06720.81
5.6.60.0170.06720.89
5.6.50.0130.05321.00
5.6.40.0130.07320.70
5.6.30.0070.04720.88
5.6.20.0100.04720.87
5.6.10.0130.08320.82
5.6.00.0170.07020.74
5.5.380.0000.08720.93
5.5.370.0000.05720.67
5.5.360.0070.08320.92
5.5.350.0100.07020.86
5.5.340.0100.08321.37
5.5.330.0100.07721.29
5.5.320.0100.07321.22
5.5.310.0030.08321.21
5.5.300.0100.07721.06
5.5.290.0030.08321.25
5.5.280.0170.05021.20
5.5.270.0070.06721.18
5.5.260.0070.08721.12
5.5.250.0130.07321.03
5.5.240.0130.08320.41
5.5.230.0070.08020.60
5.5.220.0100.07720.57
5.5.210.0070.04020.72
5.5.200.0070.05320.64
5.5.190.0100.07020.45
5.5.180.0070.08320.56
5.5.160.0130.06320.66
5.5.150.0100.07320.59
5.5.140.0070.04020.57
5.5.130.0100.08020.60
5.5.120.0130.07320.57
5.5.110.0100.09320.55
5.5.100.0100.06720.31
5.5.90.0100.07720.34
5.5.80.0130.06020.33
5.5.70.0100.07320.56
5.5.60.0200.07020.60
5.5.50.0130.07020.45
5.5.40.0070.08320.41
5.5.30.0100.07320.28
5.5.20.0000.06020.44
5.5.10.0100.07020.55
5.5.00.0170.07020.33
5.4.450.0100.07719.77
5.4.440.0100.04019.80
5.4.430.0130.04719.59
5.4.420.0200.07319.63
5.4.410.0100.07319.61
5.4.400.0130.06019.27
5.4.390.0070.08319.30
5.4.380.0070.09319.47
5.4.370.0100.07019.60
5.4.360.0070.07019.34
5.4.350.0100.07719.35
5.4.340.0130.07319.40
5.4.320.0100.04019.38
5.4.310.0100.06019.38
5.4.300.0130.07319.29
5.4.290.0000.08719.41
5.4.280.0100.05719.35
5.4.270.0100.07019.27
5.4.260.0100.04319.26
5.4.250.0100.04019.40
5.4.240.0070.08019.39
5.4.230.0170.04719.48
5.4.220.0130.07319.48
5.4.210.0130.07719.41
5.4.200.0100.06019.46
5.4.190.0070.07719.34
5.4.180.0100.07719.59
5.4.170.0100.04019.55
5.4.160.0000.06719.41
5.4.150.0070.07319.37
5.4.140.0070.07716.89
5.4.130.0100.07316.88
5.4.120.0130.06316.76
5.4.110.0130.06316.83
5.4.100.0100.06716.86
5.4.90.0100.07016.83
5.4.80.0130.07016.77
5.4.70.0100.07716.79
5.4.60.0170.06316.86
5.4.50.0070.06016.73
5.4.40.0130.07016.80
5.4.30.0070.07716.75
5.4.20.0070.04716.77
5.4.10.0170.06716.91
5.4.00.0000.06016.20
5.3.290.0130.06015.00
5.3.280.0100.04314.73
5.3.270.0070.05714.89
5.3.260.0030.07714.94
5.3.250.0000.07714.90
5.3.240.0100.06714.91
5.3.230.0170.06314.81
5.3.220.0030.05314.79
5.3.210.0070.08014.78
5.3.200.0100.03314.95
5.3.190.0070.07014.74
5.3.180.0030.08014.95
5.3.170.0030.06714.90
5.3.160.0130.07014.86
5.3.150.0170.07014.75
5.3.140.0070.07714.78
5.3.130.0100.04014.85
5.3.120.0100.08014.80
5.3.110.0070.07014.75
5.3.100.0030.08014.34
5.3.90.0000.07314.21
5.3.80.0070.04314.19
5.3.70.0100.07014.32
5.3.60.0030.04314.30
5.3.50.0130.06714.16
5.3.40.0070.04714.11
5.3.30.0070.07714.16
5.3.20.0130.04313.98
5.3.10.0070.07013.95
5.3.00.0100.07314.02
5.2.170.0030.06311.45
5.2.160.0000.06711.45
5.2.150.0100.05311.53
5.2.140.0030.06311.44
5.2.130.0030.04711.40
5.2.120.0100.04711.28
5.2.110.0030.06011.31
5.2.100.0070.06311.29
5.2.90.0170.03311.32
5.2.80.0070.06311.38
5.2.70.0100.06311.31
5.2.60.0170.04011.23
5.2.50.0070.04711.32
5.2.40.0030.03011.16
5.2.30.0100.02311.27
5.2.20.0030.03011.24
5.2.10.0000.03011.21
5.2.00.0000.04011.02
5.1.60.0070.02010.38
5.1.50.0000.02710.13
5.1.40.0030.02710.41
5.1.30.0000.04010.64
5.1.20.0030.02310.65
5.1.10.0000.02710.20
5.1.00.0000.02710.45
5.0.50.0000.0208.86
5.0.40.0070.0338.77
5.0.30.0030.0638.38
5.0.20.0070.0338.53
5.0.10.0000.0238.46
5.0.00.0000.0508.47
4.4.90.0070.0308.25
4.4.80.0070.0308.25
4.4.70.0000.0208.25
4.4.60.0030.0178.25
4.4.50.0030.0178.25
4.4.40.0000.0308.25
4.4.30.0000.0178.25
4.4.20.0000.0238.25
4.4.10.0030.0138.25
4.4.00.0000.0238.25
4.3.110.0000.0178.25
4.3.100.0000.0378.25
4.3.90.0000.0208.25
4.3.80.0000.0238.25
4.3.70.0030.0338.25
4.3.60.0030.0338.25
4.3.50.0030.0238.25
4.3.40.0070.0278.25
4.3.30.0000.0208.25
4.3.20.0030.0278.25
4.3.10.0070.0178.25
4.3.00.0000.0138.25

preferences:
59.4 ms | 400 KiB | 5 Q