3v4l.org

run code in 300+ PHP versions simultaneously
<?php //////============================== //*********** echo "what now"; exit; 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.0110.00418.30
8.3.50.0110.00521.08
8.3.40.0040.01118.89
8.3.30.0140.00019.98
8.3.20.0040.00420.36
8.3.10.0040.00421.00
8.3.00.0000.00822.52
8.2.180.0170.00316.63
8.2.170.0100.01022.96
8.2.160.0030.01022.25
8.2.150.0030.01324.18
8.2.140.0120.00624.66
8.2.130.0090.00926.16
8.2.120.0110.00920.66
8.2.110.0060.00322.32
8.2.100.0090.00317.93
8.2.90.0040.00419.21
8.2.80.0000.00817.97
8.2.70.0030.00617.50
8.2.60.0030.00617.80
8.2.50.0080.00018.10
8.2.40.0080.00320.55
8.2.30.0080.00019.60
8.2.20.0060.00317.84
8.2.10.0080.00017.80
8.2.00.0000.00717.88
8.1.280.0110.00725.92
8.1.270.0070.01123.99
8.1.260.0090.00926.35
8.1.250.0030.00628.09
8.1.240.0090.00019.26
8.1.230.0060.00617.71
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0030.00617.36
8.1.190.0000.00817.48
8.1.180.0080.00018.10
8.1.170.0030.00618.43
8.1.160.0050.00319.00
8.1.150.0030.00518.47
8.1.140.0000.00717.29
8.1.130.0050.00517.91
8.1.120.0000.00717.29
8.1.110.0040.00417.43
8.1.100.0040.00417.34
8.1.90.0000.00717.29
8.1.80.0000.00717.37
8.1.70.0050.00217.36
8.1.60.0030.00717.40
8.1.50.0000.00817.57
8.1.40.0080.00017.38
8.1.30.0030.00617.60
8.1.20.0030.00617.71
8.1.10.0000.00817.50
8.1.00.0000.00717.30
8.0.300.0070.00018.77
8.0.290.0080.00016.88
8.0.280.0000.00718.44
8.0.270.0000.00717.25
8.0.260.0040.00416.88
8.0.250.0050.00216.85
8.0.240.0040.00416.97
8.0.230.0000.00816.98
8.0.220.0030.00516.89
8.0.210.0000.00716.84
8.0.200.0000.00716.95
8.0.190.0000.00816.92
8.0.180.0030.00616.81
8.0.170.0040.00416.80
8.0.160.0000.00716.79
8.0.150.0040.00416.84
8.0.140.0000.00816.90
8.0.130.0000.00513.34
8.0.120.0080.00016.80
8.0.110.0030.00616.73
8.0.100.0000.00716.71
8.0.90.0000.00816.78
8.0.80.0070.01416.91
8.0.70.0000.00816.96
8.0.60.0080.00016.91
8.0.50.0040.00416.77
8.0.30.0060.01816.97
8.0.20.0050.01417.40
8.0.10.0000.00816.94
8.0.00.0090.00816.69
7.4.330.0000.00516.79
7.4.320.0000.00716.48
7.4.300.0000.00716.43
7.4.290.0000.00716.36
7.4.280.0000.00716.53
7.4.270.0030.00316.53
7.4.260.0060.00013.15
7.4.250.0040.00416.46
7.4.240.0020.00516.37
7.4.230.0000.00716.23
7.4.220.0060.01216.56
7.4.210.0080.00716.52
7.4.200.0050.00216.54
7.4.190.0000.00816.40
7.4.160.0030.01216.65
7.4.150.0060.01317.40
7.4.140.0080.01017.86
7.4.130.0060.01416.38
7.4.120.0090.01216.60
7.4.110.0090.00916.41
7.4.100.0070.01016.54
7.4.90.0170.00616.29
7.4.80.0060.01719.39
7.4.70.0090.00916.51
7.4.60.0100.01716.43
7.4.50.0050.00316.62
7.4.40.0130.00322.77
7.4.30.0120.01016.47
7.4.00.0060.00914.83
7.3.330.0000.00513.27
7.3.320.0060.00013.11
7.3.310.0040.00416.21
7.3.300.0030.00516.16
7.3.290.0030.01716.34
7.3.280.0100.00816.29
7.3.270.0110.00817.40
7.3.260.0120.00718.24
7.3.250.0090.00716.40
7.3.240.0090.01216.40
7.3.230.0070.01116.55
7.3.210.0090.00916.25
7.3.200.0120.01019.39
7.3.190.0070.01016.32
7.3.180.0120.00316.58
7.3.170.0080.00816.48
7.3.160.0120.00316.37
7.3.120.0030.01314.73
7.3.110.0070.01114.88
7.3.100.0120.00614.94
7.3.90.0160.00014.82
7.3.80.0080.00314.57
7.3.70.0130.00314.93
7.3.60.0040.00714.89
7.3.50.0100.00314.60
7.3.40.0130.00314.54
7.3.30.0000.01814.73
7.3.20.0100.00716.57
7.3.10.0090.00616.48
7.3.00.0050.00516.65
7.2.330.0100.00716.83
7.2.320.0130.00716.44
7.2.310.0090.00916.75
7.2.300.0000.01616.48
7.2.290.0130.00316.65
7.2.240.0170.00015.05
7.2.230.0120.00414.91
7.2.220.0030.01314.75
7.2.210.0060.00615.02
7.2.200.0060.01215.00
7.2.190.0040.01115.08
7.2.180.0090.00615.09
7.2.170.0120.00314.87
7.2.160.0130.00315.01
7.2.150.0040.00816.93
7.2.140.0070.01016.63
7.2.130.0100.00616.86
7.2.120.0000.00916.74
7.2.110.0060.00616.90
7.2.100.0040.00716.93
7.2.90.0030.00917.10
7.2.80.0050.00516.77
7.2.70.0070.00717.07
7.2.60.0060.00616.75
7.2.50.0070.01016.60
7.2.40.0080.00416.91
7.2.30.0040.00716.69
7.2.20.0090.00316.90
7.2.10.0040.01416.52
7.2.00.0040.01217.70
7.1.330.0000.01615.34
7.1.320.0040.01415.94
7.1.310.0070.00715.52
7.1.300.0060.00915.89
7.1.290.0060.00915.58
7.1.280.0040.00815.48
7.1.270.0030.01015.82
7.1.260.0030.00715.63
7.1.250.0080.00515.84
7.1.200.0040.00415.80
7.1.100.0040.01117.82
7.1.70.0000.01116.67
7.1.60.0130.01319.17
7.1.50.0120.01216.86
7.1.00.0030.06722.46
7.0.200.0000.00816.73
7.0.140.0000.07322.18
7.0.110.0200.07320.05
7.0.100.0170.08020.07
7.0.90.0100.05320.04
7.0.80.0070.09020.13
7.0.70.0100.08319.94
7.0.60.0100.05020.18
7.0.50.0100.08019.96
7.0.40.0070.08019.62
7.0.30.0170.06319.72
7.0.20.0200.07019.70
7.0.10.0130.07319.72
7.0.00.0130.08319.75
5.6.280.0000.07721.11
5.6.260.0030.05720.65
5.6.250.0100.07720.58
5.6.240.0070.08320.51
5.6.230.0100.07320.74
5.6.220.0070.06320.70
5.6.210.0100.08720.66
5.6.200.0100.08020.63
5.6.190.0030.08720.60
5.6.180.0100.05320.74
5.6.170.0070.08320.54
5.6.160.0100.04720.58
5.6.150.0200.06720.88
5.6.140.0030.08720.65
5.6.130.0130.06720.61
5.6.120.0070.06720.64
5.6.110.0070.07720.68
5.6.100.0130.07720.60
5.6.90.0070.07320.57
5.6.80.0100.07720.27
5.6.70.0100.06320.09
5.6.60.0030.08320.24
5.6.50.0130.03319.98
5.6.40.0070.03320.09
5.6.30.0100.07320.00
5.6.20.0070.05020.04
5.6.10.0030.04019.97
5.6.00.0100.03320.04
5.5.380.0100.07017.54
5.5.370.0030.07317.72
5.5.360.0000.08717.70
5.5.350.0070.06317.66
5.5.340.0070.07018.00
5.5.330.0030.08717.98
5.5.320.0030.04318.16
5.5.310.0070.07718.17
5.5.300.0070.05318.25
5.5.290.0030.06718.08
5.5.280.0200.04718.00
5.5.270.0030.05318.27
5.5.260.0070.08318.27
5.5.250.0130.06317.94
5.5.240.0070.06017.49
5.5.230.0100.07317.51
5.5.220.0100.07317.33
5.5.210.0100.09017.32
5.5.200.0000.08317.52
5.5.190.0000.07317.30
5.5.180.0000.04017.51
5.5.160.0000.04017.23
5.5.150.0100.05317.48
5.5.140.0100.07017.51
5.5.130.0000.03717.52
5.5.120.0070.06717.48
5.5.110.0070.04317.46
5.5.100.0070.03317.23
5.5.90.0030.05317.36
5.5.80.0070.06017.25
5.5.70.0000.09017.34
5.5.60.0070.03017.21
5.5.50.0030.03717.49
5.5.40.0030.04017.40
5.5.30.0030.04717.19
5.5.20.0070.03017.41
5.5.10.0030.03717.11
5.5.00.0070.03317.37
5.4.450.0130.08019.64
5.4.440.0100.07019.31
5.4.430.0100.07319.55
5.4.420.0170.07019.50
5.4.410.0270.06019.14
5.4.400.0100.07319.19
5.4.390.0030.05719.01
5.4.380.0000.07019.14
5.4.370.0070.06318.95
5.4.360.0030.03319.14
5.4.350.0030.03719.34
5.4.340.0070.05319.23
5.4.320.0070.03719.09
5.4.310.0070.02718.95
5.4.300.0000.08319.11
5.4.290.0000.05019.18
5.4.280.0130.06319.02
5.4.270.0070.04318.95
5.4.260.0000.05019.03
5.4.250.0000.04019.18
5.4.240.0070.03319.03
5.4.230.0000.08319.23
5.4.220.0030.04718.98
5.4.210.0070.07319.21
5.4.200.0070.03319.30
5.4.190.0000.07019.27
5.4.180.0000.03319.13
5.4.170.0070.03319.15
5.4.160.0000.04319.23
5.4.150.0030.04019.00
5.4.140.0030.03716.39
5.4.130.0070.03016.61
5.4.120.0000.04016.57
5.4.110.0030.04716.43
5.4.100.0070.05316.46
5.4.90.0030.03016.56
5.4.80.0030.03316.27
5.4.70.0000.03716.57
5.4.60.0030.04316.52
5.4.50.0000.03716.26
5.4.40.0030.04316.29
5.4.30.0070.03316.53
5.4.20.0070.03016.39
5.4.10.0070.04016.64
5.4.00.0030.03015.85
5.3.290.0070.03014.79
5.3.280.0100.06314.71
5.3.270.0000.04014.79
5.3.260.0000.04014.65
5.3.250.0000.03714.68
5.3.240.0070.02714.77
5.3.230.0000.03714.86
5.3.220.0030.03714.83
5.3.210.0070.04714.61
5.3.200.0000.03714.73
5.3.190.0030.03714.61
5.3.180.0000.04014.61
5.3.170.0000.04014.82
5.3.160.0000.03314.62
5.3.150.0070.03014.60
5.3.140.0100.04714.67
5.3.130.0000.04714.59
5.3.120.0070.04314.71
5.3.110.0070.04014.72
5.3.100.0000.03314.09
5.3.90.0030.03314.18
5.3.80.0000.04014.19
5.3.70.0070.05014.13
5.3.60.0100.04014.01
5.3.50.0070.03713.97
5.3.40.0070.05714.11
5.3.30.0000.07314.17
5.3.20.0100.06313.81
5.3.10.0030.07313.76
5.3.00.0100.06013.75
5.2.170.0030.02711.15
5.2.160.0030.02711.21
5.2.150.0000.07011.25
5.2.140.0100.05711.25
5.2.130.0070.05711.13
5.2.120.0070.04711.37
5.2.110.0030.06011.27
5.2.100.0030.06311.14
5.2.90.0030.06311.21
5.2.80.0000.06311.15
5.2.70.0000.06711.14
5.2.60.0000.06011.16
5.2.50.0030.05711.07
5.2.40.0030.06011.03
5.2.30.0070.06011.00
5.2.20.0030.04710.96
5.2.10.0100.02710.89
5.2.00.0170.04310.75
5.1.60.0030.0309.99
5.1.50.0070.05010.01
5.1.40.0070.04710.08
5.1.30.0000.06710.46
5.1.20.0070.02710.27
5.1.10.0030.02310.11
5.1.00.0030.04710.09
5.0.50.0000.0209.24
5.0.40.0070.0309.24
5.0.30.0030.0279.24
5.0.20.0000.0239.24
5.0.10.0030.0179.24
5.0.00.0000.0279.24
4.4.90.0000.0209.24
4.4.80.0030.0279.24
4.4.70.0030.0209.24
4.4.60.0070.0139.24
4.4.50.0030.0309.24
4.4.40.0070.0379.24
4.4.30.0030.0379.24
4.4.20.0030.0279.24
4.4.10.0070.0279.24
4.4.00.0000.0379.24
4.3.110.0000.0209.24
4.3.100.0000.0139.24
4.3.90.0000.0139.24
4.3.80.0070.0409.24
4.3.70.0000.0339.24
4.3.60.0030.0339.24
4.3.50.0000.0509.24
4.3.40.0030.0539.24
4.3.30.0000.0209.24
4.3.20.0030.0339.24
4.3.10.0070.0309.24
4.3.00.0000.0279.24

preferences:
43.62 ms | 401 KiB | 5 Q