3v4l.org

run code in 300+ PHP versions simultaneously
<?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 git.master, git.master_jit, rfc.property-hooks
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.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.67 ms | 402 KiB | 8 Q