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; ?>

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.0090.01218.65
8.3.50.0130.00721.33
8.3.40.0030.01319.21
8.3.30.0180.00420.81
8.3.20.0080.00022.34
8.3.10.0030.00621.39
8.3.00.0080.00022.72
8.2.180.0140.00417.13
8.2.170.0040.01122.96
8.2.160.0140.00722.29
8.2.150.0090.00024.18
8.2.140.0090.00024.66
8.2.130.0000.00826.16
8.2.120.0050.00321.05
8.2.110.0100.00020.53
8.2.100.0080.00418.03
8.2.90.0030.00519.42
8.2.80.0060.00318.29
8.2.70.0030.00617.75
8.2.60.0040.00418.15
8.2.50.0000.00818.07
8.2.40.0000.00818.46
8.2.30.0040.00419.87
8.2.20.0000.00917.98
8.2.10.0040.00418.06
8.2.00.0080.00017.98
8.1.280.0030.01225.92
8.1.270.0060.00323.99
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00322.44
8.1.230.0060.00724.15
8.1.220.0000.00819.05
8.1.210.0030.00618.77
8.1.200.0000.00917.61
8.1.190.0050.00317.78
8.1.180.0000.00818.10
8.1.170.0000.00818.94
8.1.160.0040.00419.18
8.1.150.0000.00918.87
8.1.140.0060.00317.72
8.1.130.0030.00518.04
8.1.120.0040.00417.68
8.1.110.0000.00817.66
8.1.100.0040.00417.66
8.1.90.0040.00417.64
8.1.80.0040.00417.61
8.1.70.0080.00017.63
8.1.60.0030.00617.78
8.1.50.0060.00317.82
8.1.40.0000.00817.73
8.1.30.0000.00817.84
8.1.20.0030.00617.81
8.1.10.0080.00017.93
8.1.00.0050.00317.64
8.0.300.0040.00420.19
8.0.290.0060.00317.55
8.0.280.0000.00718.64
8.0.270.0040.00417.51
8.0.260.0070.00317.13
8.0.250.0000.00717.22
8.0.240.0030.00617.22
8.0.230.0000.00817.22
8.0.220.0020.00517.12
8.0.210.0050.00317.09
8.0.200.0030.00317.16
8.0.190.0030.00617.09
8.0.180.0030.00517.17
8.0.170.0040.00417.29
8.0.160.0000.00717.31
8.0.150.0070.00017.08
8.0.140.0030.00517.11
8.0.130.0030.00513.74
8.0.120.0060.00317.18
8.0.110.0030.00517.16
8.0.100.0000.00817.25
8.0.90.0080.00017.21
8.0.80.0070.01017.18
8.0.70.0000.00817.12
8.0.60.0050.00317.35
8.0.50.0030.00517.25
8.0.30.0130.00917.29
8.0.20.0130.00717.40
8.0.10.0040.00417.34
8.0.00.0120.01017.11
7.4.330.0060.00017.04
7.4.320.0000.00716.80
7.4.300.0000.00716.80
7.4.290.0070.00016.87
7.4.280.0030.00316.77
7.4.270.0030.00516.59
7.4.260.0030.00313.54
7.4.250.0000.00816.77
7.4.240.0060.00216.87
7.4.230.0050.00216.97
7.4.220.0100.01716.92
7.4.210.0080.00816.86
7.4.200.0000.00716.86
7.4.190.0060.00316.77
7.4.160.0090.00916.75
7.4.150.0120.00617.40
7.4.140.0140.00517.86
7.4.130.0080.01116.80
7.4.120.0100.00916.96
7.4.110.0120.00617.08
7.4.100.0100.01016.85
7.4.90.0100.00816.80
7.4.80.0110.00719.39
7.4.70.0060.01116.99
7.4.60.0070.01116.92
7.4.50.0030.00616.76
7.4.40.0060.00622.77
7.4.30.0060.01216.84
7.4.00.0070.01015.19
7.3.330.0030.00313.50
7.3.320.0030.00313.59
7.3.310.0050.00316.73
7.3.300.0040.00416.70
7.3.290.0140.00416.70
7.3.280.0110.00816.70
7.3.270.0000.02017.40
7.3.260.0130.00618.24
7.3.250.0090.00916.83
7.3.240.0120.01516.75
7.3.230.0170.00416.62
7.3.210.0100.01616.84
7.3.200.0170.00619.39
7.3.190.0100.01316.78
7.3.180.0060.01216.97
7.3.170.0090.00916.83
7.3.160.0060.01616.66
7.3.120.0110.00415.36
7.3.10.0120.00317.05
7.3.00.0030.01116.63
7.2.330.0100.01416.84
7.2.320.0070.01116.76
7.2.310.0100.01417.11
7.2.300.0090.00916.89
7.2.290.0140.00416.77
7.2.130.0110.00417.10
7.2.120.0030.01217.18
7.2.110.0040.01117.18
7.2.100.0120.00617.13
7.2.90.0120.00317.25
7.2.80.0080.00617.36
7.2.70.0060.00617.02
7.2.60.0070.00916.97
7.2.50.0090.00617.20
7.2.40.0060.00317.31
7.2.30.0080.00417.29
7.2.20.0100.00617.24
7.2.10.0130.00317.21
7.2.00.0070.00718.45
7.1.250.0100.00316.09
7.1.200.0050.01015.72
7.1.100.0030.01018.18
7.1.70.0090.00017.60
7.1.60.0140.01019.17
7.1.50.0070.01417.21
7.1.00.0130.06322.71
7.0.200.0030.00516.92
7.0.140.0070.07322.36
7.0.110.0170.07720.42
7.0.100.0030.08320.48
7.0.90.0170.05320.26
7.0.80.0130.07720.35
7.0.70.0130.04720.36
7.0.60.0100.08020.36
7.0.50.0830.07020.90
7.0.40.0030.08020.48
7.0.30.0070.08720.76
7.0.20.0070.08020.41
7.0.10.0200.04320.50
7.0.00.0200.07020.39
5.6.280.0000.08021.40
5.6.260.0100.08321.01
5.6.250.0000.06321.13
5.6.240.0070.08721.17
5.6.230.0100.07720.95
5.6.220.0030.04321.19
5.6.210.0170.07020.93
5.6.200.0130.08021.43
5.6.190.0100.07721.34
5.6.180.0070.07021.61
5.6.170.0170.07721.41
5.6.160.0070.05021.46
5.6.150.0170.04721.45
5.6.140.0100.08021.57
5.6.130.0130.08321.40
5.6.120.0100.08321.71
5.6.110.0030.09021.38
5.6.100.0170.07021.40
5.6.90.0030.08721.58
5.6.80.0070.05321.18
5.6.70.0100.07020.82
5.6.60.0000.05720.75
5.6.50.0030.08720.74
5.6.40.0070.06320.78
5.6.30.0130.07320.74
5.6.20.0070.08020.82
5.6.10.0100.08020.95
5.6.00.0070.08720.72
5.5.380.0130.07720.76
5.5.370.0030.08720.77
5.5.360.0200.06720.98
5.5.350.0130.08020.88
5.5.340.0100.08021.23
5.5.330.0130.04321.47
5.5.320.0130.07721.26
5.5.310.0070.08721.16
5.5.300.0030.08721.22
5.5.290.0130.06721.20
5.5.280.0100.05321.21
5.5.270.0100.08021.26
5.5.260.0100.06721.54
5.5.250.0100.08020.97
5.5.240.0070.04020.84
5.5.230.0070.08320.66
5.5.220.0100.07720.65
5.5.210.0100.07320.54
5.5.200.0130.07720.55
5.5.190.0070.08320.47
5.5.180.0100.07720.58
5.5.160.0070.08320.57
5.5.150.0030.07720.50
5.5.140.0070.07720.56
5.5.130.0070.08320.64
5.5.120.0130.07320.51
5.5.110.0000.08720.60
5.5.100.0130.07020.50
5.5.90.0100.07020.47
5.5.80.0130.03720.79
5.5.70.0100.07720.46
5.5.60.0170.03720.74
5.5.50.0130.07320.52
5.5.40.0070.07720.63
5.5.30.0170.07020.45
5.5.20.0030.08020.51
5.5.10.0070.07320.44
5.5.00.0130.07020.38
5.4.450.0100.08019.73
5.4.440.0130.07719.76
5.4.430.0230.06720.02
5.4.420.0130.04319.60
5.4.410.0030.08319.43
5.4.400.0070.08019.54
5.4.390.0100.07719.41
5.4.380.0100.07319.29
5.4.370.0100.07719.56
5.4.360.0000.08319.40
5.4.350.0170.06719.54
5.4.340.0030.07719.26
5.4.320.0130.07319.42
5.4.310.0130.07319.54
5.4.300.0130.07019.25
5.4.290.0130.04319.24
5.4.280.0100.07019.68
5.4.270.0130.06719.55
5.4.260.0030.08019.26
5.4.250.0100.07319.45
5.4.240.0070.07319.54
5.4.230.0100.07719.29
5.4.220.0130.07319.22
5.4.210.0030.05019.54
5.4.200.0100.07019.21
5.4.190.0030.08319.25
5.4.180.0100.07719.45
5.4.170.0070.07719.23
5.4.160.0070.04719.48
5.4.150.0070.04719.39
5.4.140.0030.06316.85
5.4.130.0100.06716.75
5.4.120.0000.05016.77
5.4.110.0070.07016.93
5.4.100.0170.06716.96
5.4.90.0100.06716.87
5.4.80.0070.06716.93
5.4.70.0070.06016.86
5.4.60.0000.08317.02
5.4.50.0100.07016.94
5.4.40.0200.06316.91
5.4.30.0100.07717.01
5.4.20.0030.06716.75
5.4.10.0030.07316.99
5.4.00.0130.06316.47
5.3.290.0100.07315.14
5.3.280.0070.07314.91
5.3.270.0070.07714.82
5.3.260.0100.07315.08
5.3.250.0070.06314.80
5.3.240.0100.06714.86
5.3.230.0130.07014.81
5.3.220.0030.07714.61
5.3.210.0100.07314.80
5.3.200.0130.07014.73
5.3.190.0100.07314.96
5.3.180.0030.07714.83
5.3.170.0100.07014.94
5.3.160.0000.07714.82
5.3.150.0100.06714.74
5.3.140.0030.07014.77
5.3.130.0000.08714.73
5.3.120.0070.07714.74
5.3.110.0100.06714.79
5.3.100.0030.08014.20
5.3.90.0100.06714.35
5.3.80.0070.06314.29
5.3.70.0070.07714.25
5.3.60.0030.03314.19
5.3.50.0070.07014.11
5.3.40.0070.07014.29
5.3.30.0100.07314.09
5.3.20.0070.07313.86
5.3.10.0100.05713.84
5.3.00.0070.07313.80
5.2.170.0000.06312.99
5.2.160.0100.05312.99
5.2.150.0070.06312.99
5.2.140.0030.06712.99
5.2.130.0030.06012.99
5.2.120.0070.06012.99
5.2.110.0030.06012.99
5.2.100.0100.05312.99
5.2.90.0100.05712.99
5.2.80.0070.06012.99
5.2.70.0070.06312.99
5.2.60.0070.06012.99
5.2.50.0070.05312.99
5.2.40.0070.05312.99
5.2.30.0070.06012.99
5.2.20.0030.06712.99
5.2.10.0070.04312.99
5.2.00.0070.03012.99
5.1.60.0030.04712.99
5.1.50.0000.06312.99
5.1.40.0100.04012.99
5.1.30.0100.05312.99
5.1.20.0030.05312.99
5.1.10.0000.04312.99
5.1.00.0100.05712.99
5.0.50.0000.02312.99
5.0.40.0000.02312.99
5.0.30.0030.03012.99
5.0.20.0000.02012.99
5.0.10.0000.02012.99
5.0.00.0030.03012.99
4.4.90.0030.02712.99
4.4.80.0030.03012.99
4.4.70.0030.01712.99
4.4.60.0030.02712.99
4.4.50.0070.02312.99
4.4.40.0030.05312.99
4.4.30.0000.03012.99
4.4.20.0000.03712.99
4.4.10.0100.01012.99
4.4.00.0000.02712.99
4.3.110.0000.01712.99
4.3.100.0070.01012.99
4.3.90.0070.01312.99
4.3.80.0000.02712.99
4.3.70.0000.01312.99
4.3.60.0030.01312.99
4.3.50.0070.01012.99
4.3.40.0000.02312.99
4.3.30.0000.01712.99
4.3.20.0030.01312.99
4.3.10.0000.01712.99
4.3.00.0000.01312.99

preferences:
52.66 ms | 401 KiB | 5 Q