3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $url = "https://ri.test.msb.se/RapportServiceWS.svc?wsdl"; $client = new SoapClient($url, array('soap_version' => SOAP_1_1, 'location' => 'https://ri.test.msb.se/RapportServiceWS.svc/basicHttpBinding', 'exceptions' => 1, 'trace' => 1 )); $headers = array(); function guid() { mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up. $charid = strtoupper(md5(uniqid(rand(), true))); $hyphen = chr(45); $uuid = 'uuid'.$hyphen .substr($charid, 0, 8).$hyphen .substr($charid, 8, 4).$hyphen .substr($charid,12, 4).$hyphen .substr($charid,16, 4).$hyphen .substr($charid,20,12).$hyphen.'1'; return $uuid; } function generate_header() { $WSSE_NS = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; $WSSE_PFX = 'wsse'; $WSU_NS = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'; $WSU_PFX = 'wsu'; $PASSWORD_TYPE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'; $username = 'TestProgram'; $password = 'jtKLGpaKZ9XqmA40QGo'; $currentTime = time(); $timestamp=gmdate('Y-m-d\TH:i:s', $currentTime).'Z'; $expiretimestamp=gmdate('Y-m-d\TH:i:s', $currentTime + 300).'Z'; $nonce=mt_rand(); $passdigest=base64_encode(pack('H*',sha1(pack('a*',$password)))); $header=' <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="'.$WSSE_NS.'" xmlns:wsu="'.$WSU_NS.'"> <wsu:Timestamp wsu:Id="_0"> <wsu:Created>'.$timestamp.'</wsu:Created> <wsu:Expires>'.$expiretimestamp.'</wsu:Expires> </wsu:Timestamp> <wsse:UsernameToken wsu:Id="'.guid().'"> <wsse:Username>'.$username.'</wsse:Username> <wsse:Password Type="'.$PASSWORD_TYPE.'">'.$password.'</wsse:Password>'. '</wsse:UsernameToken>'. '</wsse:Security>'; $headerSoapVar=new SoapVar($header,XSD_ANYXML); $soapheader=new SoapHeader($WSSE_NS, "Security" , $headerSoapVar , true); return $soapheader; } $headers[] = generate_header(); $client->__setSoapHeaders($headers); $params = array(); $pingresult = $client->Ping($params); echo $pingresult->PingResult; var_dump($pingresult); } catch (SoapFault $e) { echo($e->getMessage()); echo '<br><br>'; echo($e); } catch (Exception $err) { echo ($e->getMessage()); echo '<br><br>'; echo($err); } ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7, 7.2.0
Fatal error: Uncaught Error: Class 'SoapClient' not found in /in/ggrkl:6 Stack trace: #0 {main} thrown in /in/ggrkl on line 6
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
Fatal error: Class 'SoapClient' not found in /in/ggrkl on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.29
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' : failed to load external entity "https://ri.test.msb.se/RapportServiceWS.svc?wsdl" <br><br>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' : failed to load external entity "https://ri.test.msb.se/RapportServiceWS.svc?wsdl" in /in/ggrkl:11 Stack trace: #0 /in/ggrkl(11): SoapClient->SoapClient('https://ri.test...', Array) #1 {main}
Process exited with code 255.
Output for 5.2.7 - 5.2.17
Notice: SoapClient::SoapClient(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/ggrkl on line 11 Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "https://ri.test.msb.se/RapportServiceWS.svc?wsdl" in /in/ggrkl on line 11 SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' : failed to load external entity "https://ri.test.msb.se/RapportServiceWS.svc?wsdl" <br><br>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' : failed to load external entity "https://ri.test.msb.se/RapportServiceWS.svc?wsdl" in /in/ggrkl:11 Stack trace: #0 /in/ggrkl(11): SoapClient->SoapClient('https://ri.test...', Array) #1 {main}
Process exited with code 255.
Output for 5.2.0 - 5.2.6
Notice: SoapClient::SoapClient(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/ggrkl on line 11 Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "https://ri.test.msb.se/RapportServiceWS.svc?wsdl" in /in/ggrkl on line 11 SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl'<br><br>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' in /in/ggrkl:11 Stack trace: #0 /in/ggrkl(11): SoapClient->SoapClient('https://ri.test...', Array) #1 {main}
Process exited with code 255.
Output for 5.1.3 - 5.1.6
Notice: SoapClient::__construct(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/ggrkl on line 11 Warning: SoapClient::__construct(): I/O warning : failed to load external entity "https://ri.test.msb.se/RapportServiceWS.svc?wsdl" in /in/ggrkl on line 11 SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl'<br><br>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' in /in/ggrkl:11 Stack trace: #0 /in/ggrkl(11): SoapClient->__construct('https://ri.test...', Array) #1 {main}
Process exited with code 255.
Output for 5.1.0 - 5.1.2
Notice: SoapClient::__construct(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/ggrkl on line 11 Warning: SoapClient::__construct(): I/O warning : failed to load external entity "https://ri.test.msb.se/RapportServiceWS.svc?wsdl" in /in/ggrkl on line 11 <br><br>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' in /in/ggrkl:11 Stack trace: #0 /in/ggrkl(11): SoapClient->__construct('https://ri.test...', Array) #1 {main}
Process exited with code 255.
Output for 5.0.4 - 5.0.5
Notice: SoapClient::__construct(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/ggrkl on line 11 Notice: SoapClient::__construct(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/ggrkl on line 11 Warning: I/O warning : failed to load external entity "https://ri.test.msb.se/RapportServiceWS.svc?wsdl" in /in/ggrkl on line 11 <br><br>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' in /in/ggrkl:11 Stack trace: #0 /in/ggrkl(11): SoapClient->__construct('https://ri.test...', Array) #1 {main}
Process exited with code 255.
Output for 5.0.3
<br><br>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' in /in/ggrkl:11 Stack trace: #0 /in/ggrkl(11): SoapClient->__construct('https://ri.test...', Array) #1 {main}
Output for 5.0.0 - 5.0.2
<br><br>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ri.test.msb.se/RapportServiceWS.svc?wsdl' in /in/ggrkl:11 Stack trace: #0 {main}
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/ggrkl on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected '{' in /in/ggrkl on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/ggrkl on line 3
Process exited with code 255.

preferences:
57.07 ms | 426 KiB | 5 Q