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 </metadataServerUrl> <passwordExpired>false</passwordExpired> <sandbox>false</sandbox> <serverUrl> https://na3.salesforce.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); // 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_ENV', 'soapenv'); define('NS_SFORCE', 'urn:enterprise.soap.sforce.com'); // $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 5.3.28 - 5.3.29, 5.4.20 - 7.1.0
Warning: main(): Node no longer exists in /in/KLK6A on line 62 Notice: Trying to get property of non-object in /in/KLK6A on line 62 Notice: Trying to get property of non-object in /in/KLK6A on line 62
Output for 5.0.1 - 5.1.1, 5.1.3 - 5.3.27, 5.4.0 - 5.4.19
Warning: main(): Node no longer exists in /in/6cCev on line 62 Notice: Trying to get property of non-object in /in/6cCev on line 62 Notice: Trying to get property of non-object in /in/6cCev on line 62
Output for 5.1.2
Warning: main(): Node no longer exists in /in/6cCev on line 63 Notice: Trying to get property of non-object in /in/6cCev on line 63 Notice: Trying to get property of non-object in /in/6cCev on line 63
Output for 5.0.0
Warning: Node no longer exists in /in/6cCev on line 62 Notice: Trying to get property of non-object in /in/6cCev on line 62 Notice: Trying to get property of non-object in /in/6cCev on line 62
Output for 4.4.3 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/6cCev on line 62
Process exited with code 255.
Output for 4.4.2
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/6cCev on line 63
Process exited with code 255.
Output for 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/6cCev on line 62
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/6cCev on line 62
Process exited with code 255.
Output for 4.3.0
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/KLK6A on line 62
Process exited with code 255.