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= "xxx" ; //$myprovider = "xxx"; //$myprovider = "xxxx"; //$mygsmchallenge= "xxx" ; $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; ?>
Output for 8.3.0 - 8.3.6
what now Warning: Undefined global variable $_SESSION in /in/f7Tu6 on line 103 Warning: Trying to access array offset on null in /in/f7Tu6 on line 103 Warning: Undefined global variable $_SESSION in /in/f7Tu6 on line 104 Warning: Trying to access array offset on null in /in/f7Tu6 on line 104 Warning: Undefined global variable $_SESSION in /in/f7Tu6 on line 105 Warning: Trying to access array offset on null in /in/f7Tu6 on line 105 Warning: Undefined global variable $_SESSION in /in/f7Tu6 on line 106 Warning: Trying to access array offset on null in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo for api2.infobip.com failed: System error in /in/f7Tu6 on line 68 Warning: fsockopen(): Unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo for api2.infobip.com failed: System error) in /in/f7Tu6 on line 68
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.18
what now Warning: Undefined global variable $_SESSION in /in/f7Tu6 on line 103 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 103 Warning: Undefined global variable $_SESSION in /in/f7Tu6 on line 104 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 104 Warning: Undefined global variable $_SESSION in /in/f7Tu6 on line 105 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 105 Warning: Undefined global variable $_SESSION in /in/f7Tu6 on line 106 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo for api2.infobip.com failed: System error in /in/f7Tu6 on line 68 Warning: fsockopen(): Unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo for api2.infobip.com failed: System error) in /in/f7Tu6 on line 68
Output for 8.0.13 - 8.0.30
what now Warning: Undefined variable $_SESSION in /in/f7Tu6 on line 103 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 103 Warning: Undefined variable $_SESSION in /in/f7Tu6 on line 104 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 104 Warning: Undefined variable $_SESSION in /in/f7Tu6 on line 105 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 105 Warning: Undefined variable $_SESSION in /in/f7Tu6 on line 106 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/f7Tu6 on line 68 Warning: fsockopen(): Unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo failed: System error) in /in/f7Tu6 on line 68
Output for 8.0.0 - 8.0.12
what now Warning: Undefined variable $_SESSION in /in/f7Tu6 on line 103 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 103 Warning: Undefined variable $_SESSION in /in/f7Tu6 on line 104 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 104 Warning: Undefined variable $_SESSION in /in/f7Tu6 on line 105 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 105 Warning: Undefined variable $_SESSION in /in/f7Tu6 on line 106 Warning: Trying to access array offset on value of type null in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/f7Tu6 on line 68 Warning: fsockopen(): Unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution) in /in/f7Tu6 on line 68
Output for 7.4.0, 7.4.27 - 7.4.33
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Trying to access array offset on value of type null in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Trying to access array offset on value of type null in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Trying to access array offset on value of type null in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Notice: Trying to access array offset on value of type null in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo failed: System error) in /in/f7Tu6 on line 68
Output for 7.3.32 - 7.3.33, 7.4.26
what now Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo failed: System error) in /in/f7Tu6 on line 68
Output for 7.4.3 - 7.4.25
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Trying to access array offset on value of type null in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Trying to access array offset on value of type null in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Trying to access array offset on value of type null in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Notice: Trying to access array offset on value of type null in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution) in /in/f7Tu6 on line 68
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution) in /in/f7Tu6 on line 68
Output for 7.0.20, 7.1.5 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.12
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo failed: System error) in /in/f7Tu6 on line 68
Output for 5.2.6 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.14, 7.1.0
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/f7Tu6 on line 68
Output for 5.1.3 - 5.1.6, 5.2.0 - 5.2.5
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (Unknown error) in /in/f7Tu6 on line 68
Output for 5.0.4 - 5.0.5, 5.1.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 12 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 13 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 14 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 15 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 16 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 17 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 18 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 19 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 22 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 23 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 24 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 25 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 26 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 27 what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (Unknown error) in /in/f7Tu6 on line 68
Output for 5.0.3
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 12 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 13 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 14 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 15 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 16 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 17 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 18 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 19 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 22 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 23 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 24 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 25 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 26 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 27 what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (Unknown error) in /in/f7Tu6 on line 68
Output for 5.0.0 - 5.0.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 12 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 13 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 14 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 15 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 16 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 17 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 18 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 19 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 22 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 23 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 24 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 25 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 26 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/f7Tu6 on line 27 what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: gethostbyname failed in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 (Unknown error) in /in/f7Tu6 on line 68
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.3.11, 4.4.0 - 4.4.9
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 in /in/f7Tu6 on line 68
Output for 4.3.5 - 4.3.9
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: gethostbyname failed in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 in /in/f7Tu6 on line 68
Output for 4.3.2
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/f7Tu6 on line 68 Warning: fsockopen(): unable to connect to api2.infobip.com:80 in /in/f7Tu6 on line 68
Output for 4.3.0 - 4.3.1
what now Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 103 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 104 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 105 Notice: Undefined variable: _SESSION in /in/f7Tu6 on line 106
Process exited with code 139.

preferences:
251.41 ms | 401 KiB | 372 Q