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"; $myproviderpassword = "peter123"; $mygsmchallenge= "hola" ; $gsm = array(); $gsm[0] = $mygsm ; $username =$myprovider ; $password =$myproviderpassword ; $sender = "Psq"; $isflash = 0; $type ="longSMS" ; $bookmark = "what mark"; $messagetext = "what now ".$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.00318.81
8.3.50.0210.00621.27
8.3.40.0150.00019.34
8.3.30.0040.01220.55
8.3.20.0050.00320.59
8.3.10.0090.00021.47
8.3.00.0000.00822.87
8.2.180.0040.01118.66
8.2.170.0070.00722.96
8.2.160.0100.00322.20
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0030.00526.16
8.2.120.0000.00820.92
8.2.110.0090.00022.42
8.2.100.0040.00817.97
8.2.90.0000.00918.41
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0070.00318.28
8.2.50.0000.01018.07
8.2.40.0060.00318.40
8.2.30.0030.00619.63
8.2.20.0040.00417.95
8.2.10.0080.00017.93
8.2.00.0030.00518.05
8.1.280.0110.00725.92
8.1.270.0040.00423.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00321.27
8.1.230.0040.00821.13
8.1.220.0030.00618.04
8.1.210.0040.00418.98
8.1.200.0060.00317.73
8.1.190.0080.00017.91
8.1.180.0060.00318.10
8.1.170.0000.00818.87
8.1.160.0000.00819.19
8.1.150.0040.00418.89
8.1.140.0000.00817.71
8.1.130.0040.00418.09
8.1.120.0030.00517.63
8.1.110.0000.00817.65
8.1.100.0000.00817.64
8.1.90.0000.00817.77
8.1.80.0000.00817.52
8.1.70.0030.00317.73
8.1.60.0060.00317.66
8.1.50.0040.00417.54
8.1.40.0030.00617.60
8.1.30.0000.00817.66
8.1.20.0060.00317.88
8.1.10.0040.00417.73
8.1.00.0030.00517.53
8.0.300.0000.00720.26
8.0.290.0030.00617.28
8.0.280.0050.00218.70
8.0.270.0060.00317.14
8.0.260.0020.00517.12
8.0.250.0000.00717.27
8.0.240.0030.00517.17
8.0.230.0040.00417.25
8.0.220.0070.00017.07
8.0.210.0050.00317.10
8.0.200.0000.00617.30
8.0.190.0040.00417.20
8.0.180.0040.00417.18
8.0.170.0000.00817.13
8.0.160.0070.00017.17
8.0.150.0040.00417.21
8.0.140.0040.00717.11
8.0.130.0060.00013.71
8.0.120.0030.00617.18
8.0.110.0030.00617.23
8.0.100.0000.00817.11
8.0.90.0080.00017.14
8.0.80.0100.01417.25
8.0.70.0030.00517.23
8.0.60.0000.00817.15
8.0.50.0060.00317.10
8.0.30.0100.01017.62
8.0.20.0140.00917.56
8.0.10.0080.00017.47
8.0.00.0140.00917.08
7.4.330.0000.00617.16
7.4.320.0030.00316.71
7.4.300.0030.00316.76
7.4.290.0030.00316.80
7.4.280.0050.00316.67
7.4.270.0040.00416.79
7.4.260.0060.00316.80
7.4.250.0040.00416.86
7.4.240.0000.00716.93
7.4.230.0050.00316.72
7.4.220.0160.00716.94
7.4.210.0080.00816.89
7.4.200.0070.00016.95
7.4.190.0000.00816.98
7.4.160.0070.01016.87
7.4.150.0130.00617.40
7.4.140.0130.00917.86
7.4.130.0160.00416.91
7.4.120.0090.00816.90
7.4.110.0110.00816.75
7.4.100.0130.00616.77
7.4.90.0080.01016.90
7.4.80.0070.01119.39
7.4.70.0150.00316.82
7.4.60.0070.01016.81
7.4.50.0060.00316.91
7.4.40.0080.00422.77
7.4.30.0130.00616.80
7.4.00.0090.00615.04
7.3.330.0000.00513.61
7.3.320.0000.00613.48
7.3.310.0020.00516.60
7.3.300.0040.00416.69
7.3.290.0040.01016.67
7.3.280.0020.01516.70
7.3.270.0120.01517.40
7.3.260.0120.01118.24
7.3.250.0140.00916.74
7.3.240.0180.00916.79
7.3.230.0080.01216.96
7.3.210.0000.01716.86
7.3.200.0120.01219.39
7.3.190.0030.02116.81
7.3.180.0100.00716.82
7.3.170.0080.00916.88
7.3.160.0090.00916.87
7.3.120.0000.01914.95
7.3.10.0090.00916.66
7.3.00.0080.00616.59
7.2.330.0090.00916.76
7.2.320.0110.00716.98
7.2.310.0060.01617.09
7.2.300.0110.00717.10
7.2.290.0110.01216.81
7.2.130.0100.01016.61
7.2.120.0140.00616.92
7.2.110.0000.02216.54
7.2.100.0140.01016.92
7.2.90.0090.01216.76
7.2.80.0140.00316.79
7.2.70.0100.00716.50
7.2.60.0070.00716.89
7.2.50.0110.00516.98
7.2.40.0070.01716.97
7.2.30.0150.00716.80
7.2.20.0080.00816.75
7.2.10.0070.01416.73
7.2.00.0030.01017.28
7.1.250.0230.00315.48
7.1.200.0110.00516.14
7.1.70.0030.00617.62
7.1.60.0030.02019.17
7.1.50.0110.01817.41
7.1.00.0000.04022.69
7.0.200.0030.00817.11
7.0.140.0100.06722.64
7.0.100.0300.08320.39
7.0.90.0070.08020.39
7.0.80.0130.08020.39
7.0.70.0070.07320.25
7.0.60.0030.05720.47
7.0.50.0100.04020.89
7.0.40.0100.03720.52
7.0.30.0030.05320.44
7.0.20.0000.06020.43
7.0.10.0030.09020.52
7.0.00.0070.05020.54
5.6.280.0070.07021.60
5.6.250.0100.08721.04
5.6.240.0100.08020.98
5.6.230.0100.04721.01
5.6.220.0100.07321.00
5.6.210.0000.06320.84
5.6.200.0100.04021.45
5.6.190.0170.07321.46
5.6.180.0130.07721.27
5.6.170.0070.08721.29
5.6.160.0170.06721.39
5.6.150.0100.05321.60
5.6.140.0130.07321.62
5.6.130.0100.07321.63
5.6.120.0200.07021.46
5.6.110.0100.08721.25
5.6.100.0200.06021.40
5.6.90.0170.06321.41
5.6.80.0030.07720.79
5.6.70.0100.08020.84
5.6.60.0070.06020.83
5.6.50.0100.07720.78
5.6.40.0070.04720.64
5.6.30.0100.07320.75
5.6.20.0130.08020.80
5.6.10.0070.07320.75
5.6.00.0030.08720.88
5.5.380.0100.08020.69
5.5.370.0070.08320.76
5.5.360.0100.04320.74
5.5.350.0070.07720.74
5.5.340.0030.04321.38
5.5.330.0130.08021.33
5.5.320.0100.08021.09
5.5.310.0030.08021.18
5.5.300.0100.05721.16
5.5.290.0030.08321.30
5.5.280.0100.07721.06
5.5.270.0130.07721.21
5.5.260.0170.08021.31
5.5.250.0030.05321.08
5.5.240.0130.07020.61
5.5.230.0130.05020.70
5.5.220.0070.06320.40
5.5.210.0030.07720.43
5.5.200.0070.07020.57
5.5.190.0030.03720.38
5.5.180.0030.04720.72
5.5.160.0200.05720.66
5.5.150.0030.06020.63
5.5.140.0030.05020.43
5.5.130.0100.07320.72
5.5.120.0030.07720.68
5.5.110.0130.07720.71
5.5.100.0070.04720.47
5.5.90.0030.08020.52
5.5.80.0130.08320.53
5.5.70.0100.07720.48
5.5.60.0070.07720.38
5.5.50.0070.03720.29
5.5.40.0130.06720.32
5.5.30.0070.04320.52
5.5.20.0100.03320.59
5.5.10.0030.04020.51
5.5.00.0000.04320.35
5.4.450.0030.07719.82
5.4.440.0200.06719.59
5.4.430.0000.08019.83
5.4.420.0070.08019.62
5.4.410.0030.07319.68
5.4.400.0070.07719.61
5.4.390.0070.04319.48
5.4.380.0130.06719.27
5.4.370.0130.05719.48
5.4.360.0070.07719.48
5.4.350.0100.03719.28
5.4.340.0030.05719.38
5.4.320.0030.08319.35
5.4.310.0070.07019.39
5.4.300.0000.07019.39
5.4.290.0030.04319.29
5.4.280.0100.04719.47
5.4.270.0070.07719.30
5.4.260.0070.06319.44
5.4.250.0070.07719.32
5.4.240.0030.04719.37
5.4.230.0100.06719.48
5.4.220.0030.04319.27
5.4.210.0200.05019.15
5.4.200.0100.07319.26
5.4.190.0070.03719.43
5.4.180.0100.02319.42
5.4.170.0030.03019.26
5.4.160.0070.03319.28
5.4.150.0030.03019.42
5.4.140.0030.03316.73
5.4.130.0030.03716.57
5.4.120.0000.04016.80
5.4.110.0000.04016.82
5.4.100.0070.03016.88
5.4.90.0030.04016.80
5.4.80.0030.04316.66
5.4.70.0100.03016.77
5.4.60.0000.04016.74
5.4.50.0070.04316.84
5.4.40.0000.04016.80
5.4.30.0100.04716.66
5.4.20.0130.04716.84
5.4.10.0070.03316.83
5.4.00.0030.03716.17
5.3.290.0100.07314.96
5.3.280.0130.07314.79
5.3.270.0000.04314.98
5.3.260.0030.03314.83
5.3.250.0000.04014.78
5.3.240.0030.03714.98
5.3.230.0030.03014.88
5.3.220.0070.03714.86
5.3.210.0000.04014.86
5.3.200.0000.04314.74
5.3.190.0070.04314.90
5.3.180.0070.04014.84
5.3.170.0000.04014.85
5.3.160.0100.02714.85
5.3.150.0070.03314.90
5.3.140.0070.03314.74
5.3.130.0070.03714.89
5.3.120.0030.04014.84
5.3.110.0030.03714.83
5.3.100.0070.03314.32
5.3.90.0000.03714.39
5.3.80.0070.03314.39
5.3.70.0000.04014.32
5.3.60.0000.04014.21
5.3.50.0030.03714.14
5.3.40.0030.03014.22
5.3.30.0030.03014.16
5.3.20.0030.03313.99
5.3.10.0000.03713.95
5.3.00.0130.03013.86
5.2.170.0000.02711.45
5.2.160.0030.03011.43
5.2.150.0070.02711.41
5.2.140.0070.02711.33
5.2.130.0030.03011.29
5.2.120.0030.02711.45
5.2.110.0030.03011.32
5.2.100.0000.03311.37
5.2.90.0070.02311.41
5.2.80.0070.02311.21
5.2.70.0030.03011.30
5.2.60.0030.03011.23
5.2.50.0070.02711.30
5.2.40.0000.03011.29
5.2.30.0000.03711.36
5.2.20.0070.03311.15
5.2.10.0030.03311.15
5.2.00.0030.03011.04
5.1.60.0000.02710.38
5.1.50.0000.02710.36
5.1.40.0030.02310.34
5.1.30.0030.05710.55
5.1.20.0100.03710.66
5.1.10.0000.02710.41
5.1.00.0070.03010.45
5.0.50.0030.0278.90
5.0.40.0000.0208.55
5.0.30.0030.0538.48
5.0.20.0000.0408.56
5.0.10.0030.0208.53
5.0.00.0000.0608.47
4.4.90.0000.0178.27
4.4.80.0030.0138.27
4.4.70.0070.0138.27
4.4.60.0000.0178.27
4.4.50.0030.0138.27
4.4.40.0000.0278.27
4.4.30.0000.0378.27
4.4.20.0000.0178.27
4.4.10.0000.0308.27
4.4.00.0030.0578.27
4.3.110.0000.0178.27
4.3.100.0070.0308.27
4.3.90.0030.0338.27
4.3.80.0000.0478.27
4.3.70.0000.0378.27
4.3.60.0030.0338.27
4.3.50.0000.0408.27
4.3.40.0030.0508.27
4.3.30.0030.0378.27
4.3.20.0000.0378.27
4.3.10.0030.0338.27
4.3.00.0000.0278.27

preferences:
40.3 ms | 401 KiB | 5 Q