3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:getBundles"> <soapenv:Header> <soapenv:Body> <urn:getBundles soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <request xsi:type="urn:getBundlesRequest" xmlns:urn="urn:SelfcareWebservice"> <userid>hexa</userid> <password>hexa123</password> <requestid>000</requestid> <msisdn>60182003838</msisdn> <productname xsi:type="xsd:string"></productname> <bundlename xsi:type="xsd:string"></bundlename> </request> </urn:getBundles> </soapenv:Body> </soapenv:Envelope>'; $sxe = new SimpleXMLElement($xml); // Define some short identifiers for namespaces without relying on their prefix in the XML define('NS_ENV', 'http://schemas.xmlsoap.org/soap/envelope/'); define('NS_SFORCE', 'getBundlesResponse'); // $sxe already represents the soapenv:Envelope node, so we don't need to mention that $result = $sxe->children(NS_ENV)->Body->children(NS_SFORCE)->loginResponse->result->serverUrl; echo $result;
Output for 7.0.0 - 7.1.0
Warning: SimpleXMLElement::__construct(): Entity: line 15: parser error : Opening and ending tag mismatch: Header line 2 and Envelope in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): </soapenv:Envelope> in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): ^ in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): Entity: line 15: parser error : Premature end of data in tag Envelope line 1 in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): </soapenv:Envelope> in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): ^ in /in/5lDQK on line 17 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/5lDQK:17 Stack trace: #0 /in/5lDQK(17): SimpleXMLElement->__construct('<soapenv:Envelo...') #1 {main} thrown in /in/5lDQK on line 17
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/5lDQK:17 Stack trace: #0 /in/5lDQK(17): SimpleXMLElement->__construct() #1 {main} Entity: line 15: parser error : Opening and ending tag mismatch: Header line 2 and Envelope </soapenv:Envelope> ^ Entity: line 15: parser error : Premature end of data in tag Envelope line 1 </soapenv:Envelope> ^
Process exited with code 255.
Output for 5.1.0 - 5.6.28
Warning: SimpleXMLElement::__construct(): Entity: line 15: parser error : Opening and ending tag mismatch: Header line 2 and Envelope in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): </soapenv:Envelope> in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): ^ in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): Entity: line 15: parser error : Premature end of data in tag Envelope line 1 in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): </soapenv:Envelope> in /in/5lDQK on line 17 Warning: SimpleXMLElement::__construct(): ^ in /in/5lDQK on line 17 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/5lDQK:17 Stack trace: #0 /in/5lDQK(17): SimpleXMLElement->__construct('<soapenv:Envelo...') #1 {main} thrown in /in/5lDQK on line 17
Process exited with code 255.
Output for 5.0.3 - 5.0.5
Warning: Entity: line 15: parser error : Opening and ending tag mismatch: Header line 2 and Envelope in /in/5lDQK on line 17 Warning: </soapenv:Envelope> in /in/5lDQK on line 17 Warning: ^ in /in/5lDQK on line 17 Warning: Entity: line 15: parser error : Premature end of data in tag Envelope line 1 in /in/5lDQK on line 17 Warning: </soapenv:Envelope> in /in/5lDQK on line 17 Warning: ^ in /in/5lDQK on line 17 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/5lDQK:17 Stack trace: #0 /in/5lDQK(17): SimpleXMLElement->__construct('<soapenv:Envelo...') #1 {main} thrown in /in/5lDQK on line 17
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Warning: Entity: line 15: parser error : Opening and ending tag mismatch: Header line 2 and Envelope in /in/5lDQK on line 17 Warning: </soapenv:Envelope> in /in/5lDQK on line 17 Warning: ^ in /in/5lDQK on line 17 Warning: Entity: line 15: parser error : Premature end of data in tag Envelope line 1 in /in/5lDQK on line 17 Warning: </soapenv:Envelope> in /in/5lDQK on line 17 Warning: ^ in /in/5lDQK on line 17 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/5lDQK:17 Stack trace: #0 {main} thrown in /in/5lDQK on line 17
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/5lDQK on line 24
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/5lDQK on line 24
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/5lDQK on line 24
Process exited with code 255.