3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = <<<EOD <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance"> <soapenv:Body> <loginResponse> <result> <metadataServerUrl> https://na3.salesforce.com/services/Soap/m/28.0/00D50000000IdrE </metadat aServerUrl> <passwordExpired>false</passwordExpired> <sandbox>false</sandbox> <serverUrl> https://abc.com/services/Soap/c/28.0/00D50000000IdrE </serverUrl> <sessionId> 00D50000000IdrE!AREAQK4VYXRaHoL_uRvOi.QXXw3ahAt2Cge254wygiW7cr_f6DVa2pDC6g57w5IE fidAu3ZRsJFBN5Bwb6DVhF18zKFiVVyT </sessionId> <userId>00550000001Dd4uAAC</userId> <userInfo> <accessibilityMode>false</accessibilityMode> <currencySymbol>$</currencySymbol> <orgAttachmentFileSizeLimit>5242880 </orgAttachmentFileSizeLimit> <orgDefaultCurrencyIsoCode>USD</orgDefaultCurrencyIsoCode> <orgDisallowHtmlAttachments>false </orgDisallowHtmlAttachments> <orgHasPersonAccounts>false</orgHasPersonAccounts> <organizationId>00D50000000IdrEEAS</organizationId> <organizationMultiCurrency>false</organizationMultiCurrency> <organizationName>3CLogic</organizationName> <profileId>00e500000017al5AAA</profileId> <roleId xsi:nil="true"/> <sessionSecondsValid>7200</sessionSecondsValid> <userDefaultCurrencyIsoCode xsi:nil="true"/> <userEmail>ramana@3clogic.com</userEmail> <userFullName>Ramana</userFullName> <userId>00550Dd4uAAC</userId> <userLanguage>en_US</userLanguage> <userLocale>en_US</userLocale> <userName>raman@gmail.com.com</userName> <userTimeZone>America/New_York</userTimeZone> <userType>Standard</userType> <userUiSkin>Theme3</userUiSkin> </userInfo> </result> </loginResponse> </soapenv:Body> </soapenv:Envelope> EOD; $sxe = new SimpleXMLElement($xml); $sxe->registerXPathNamespace('env', 'http://schemas.xmlsoap.org/soap/envelope/ '); $sxe->registerXPathNamespace('def', 'urn:enterprise.soap.sforce.com'); $result = $sxe->xpath('/env:Envelope/env:Body/def:loginResponse/def:result/def:serverUrl');
Output for 7.0.0 - 7.1.0
Warning: SimpleXMLElement::__construct(): namespace error : xmlns:xsi: 'http://www.w3.org/2001/XMLSchema- instance' is not a valid URI in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance"> in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): ^ in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): Entity: line 10: parser error : expected '>' in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): </metadat aServerUrl> in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): ^ in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): Entity: line 10: parser error : Opening and ending tag mismatch: metadataServerUrl line 8 and metadat in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): </metadat aServerUrl> in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): ^ in /in/D0ahW on line 54 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/D0ahW:54 Stack trace: #0 /in/D0ahW(54): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/D0ahW on line 54
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/D0ahW:54 Stack trace: #0 /in/D0ahW(54): SimpleXMLElement->__construct() #1 {main} namespace error : xmlns:xsi: 'http://www.w3.org/2001/XMLSchema- instance' is not a valid URI xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance"> ^ Entity: line 10: parser error : expected '>' </metadat aServerUrl> ^ Entity: line 10: parser error : Opening and ending tag mismatch: metadataServerUrl line 8 and metadat </metadat aServerUrl> ^
Process exited with code 255.
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.6.28
Warning: SimpleXMLElement::__construct(): namespace error : xmlns:xsi: 'http://www.w3.org/2001/XMLSchema- instance' is not a valid URI in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance"> in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): ^ in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): Entity: line 10: parser error : expected '>' in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): </metadat aServerUrl> in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): ^ in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): Entity: line 10: parser error : Opening and ending tag mismatch: metadataServerUrl line 8 and metadat in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): </metadat aServerUrl> in /in/D0ahW on line 54 Warning: SimpleXMLElement::__construct(): ^ in /in/D0ahW on line 54 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/D0ahW:54 Stack trace: #0 /in/D0ahW(54): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/D0ahW on line 54
Process exited with code 255.
Output for 5.1.2
Warning: SimpleXMLElement::__construct(): namespace error : xmlns:xsi: 'http://www.w3.org/2001/XMLSchema- instance' is not a valid URI in /in/D0ahW on line 55 Warning: SimpleXMLElement::__construct(): xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance"> in /in/D0ahW on line 55 Warning: SimpleXMLElement::__construct(): ^ in /in/D0ahW on line 55 Warning: SimpleXMLElement::__construct(): Entity: line 10: parser error : expected '>' in /in/D0ahW on line 55 Warning: SimpleXMLElement::__construct(): </metadat aServerUrl> in /in/D0ahW on line 55 Warning: SimpleXMLElement::__construct(): ^ in /in/D0ahW on line 55 Warning: SimpleXMLElement::__construct(): Entity: line 10: parser error : Opening and ending tag mismatch: metadataServerUrl line 8 and metadat in /in/D0ahW on line 55 Warning: SimpleXMLElement::__construct(): </metadat aServerUrl> in /in/D0ahW on line 55 Warning: SimpleXMLElement::__construct(): ^ in /in/D0ahW on line 55 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/D0ahW:55 Stack trace: #0 /in/D0ahW(55): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/D0ahW on line 55
Process exited with code 255.
Output for 5.0.3 - 5.0.5
Warning: namespace error : xmlns:xsi: 'http://www.w3.org/2001/XMLSchema- instance' is not a valid URI in /in/D0ahW on line 54 Warning: xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance"> in /in/D0ahW on line 54 Warning: ^ in /in/D0ahW on line 54 Warning: Entity: line 10: parser error : expected '>' in /in/D0ahW on line 54 Warning: </metadat aServerUrl> in /in/D0ahW on line 54 Warning: ^ in /in/D0ahW on line 54 Warning: Entity: line 10: parser error : Opening and ending tag mismatch: metadataServerUrl line 8 and metadat in /in/D0ahW on line 54 Warning: </metadat aServerUrl> in /in/D0ahW on line 54 Warning: ^ in /in/D0ahW on line 54 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/D0ahW:54 Stack trace: #0 /in/D0ahW(54): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/D0ahW on line 54
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Warning: namespace error : xmlns:xsi: 'http://www.w3.org/2001/XMLSchema- instance' is not a valid URI in /in/D0ahW on line 54 Warning: xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance"> in /in/D0ahW on line 54 Warning: ^ in /in/D0ahW on line 54 Warning: Entity: line 10: parser error : expected '>' in /in/D0ahW on line 54 Warning: </metadat aServerUrl> in /in/D0ahW on line 54 Warning: ^ in /in/D0ahW on line 54 Warning: Entity: line 10: parser error : Opening and ending tag mismatch: metadataServerUrl line 8 and metadat in /in/D0ahW on line 54 Warning: </metadat aServerUrl> in /in/D0ahW on line 54 Warning: ^ in /in/D0ahW on line 54 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/D0ahW:54 Stack trace: #0 {main} thrown in /in/D0ahW on line 54
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/D0ahW on line 54
Process exited with code 255.
Output for 4.4.2
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/D0ahW on line 55
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/D0ahW on line 54