3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<?xml version="1.0" encoding="UTF-8"?> <Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><Body><Fault><Code><Value>SOAP-ENV:Receiver</Value></Code><Reason><Text>OMS login failure: Problem in OMS UAMS login - Nested Exception/Error: java.net.ConnectException: Tried all: \'1\' addresses, but could not connect over HTTP to server: \'nlut02hr\', port: \'40100\' </Text></Reason><Role>BEA</Role><Detail><error xmlns:bsl="http://com.amdocs.bss.bsl/"><errorCode>BSL-14002</errorCode><errorMessage>Generic exception returned from external system</errorMessage><detail><fault xmlns:con="http://www.bea.com/wli/sb/context"><errorCode>BEA-380000</errorCode><location><node>getAddOnsRouteNode</node><path>response-pipeline</path></location></fault></detail></error></Detail></Fault></Body></Envelope>' ; $xml = new SimpleXMLElement($str); foreach ($xml->getNamespaces(true) as $ns => $uri) { $str = str_replace(sprintf('%s:', $ns), '', $str); } $xml = new SimpleXMLElement($str); var_dump(objectToArray($xml)); function objectToArray($data) { if (is_object($data)) { $data = get_object_vars($data); } if (is_array($data)) { // return array_map('objectToArray', $data); } else { // return $data; } return $data; }
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["Body"]=> object(SimpleXMLElement)#1 (1) { ["Fault"]=> object(SimpleXMLElement)#3 (4) { ["Code"]=> object(SimpleXMLElement)#4 (1) { ["Value"]=> string(17) "SOAP-ENV:Receiver" } ["Reason"]=> object(SimpleXMLElement)#5 (1) { ["Text"]=> string(201) "OMS login failure: Problem in OMS UAMS login - Nested Exception/Error: java.net.ConnectException: Tried all: '1' addresses, but could not connect over HTTP to server: 'nlut02hr', port: '40100' " } ["Role"]=> string(3) "BEA" ["Detail"]=> object(SimpleXMLElement)#6 (1) { ["error"]=> object(SimpleXMLElement)#7 (3) { ["errorCode"]=> string(9) "BSL-14002" ["errorMessage"]=> string(47) "Generic exception returned from external system" ["detail"]=> object(SimpleXMLElement)#8 (1) { ["fault"]=> object(SimpleXMLElement)#9 (2) { ["errorCode"]=> string(10) "BEA-380000" ["location"]=> object(SimpleXMLElement)#10 (2) { ["node"]=> string(18) "getAddOnsRouteNode" ["path"]=> string(17) "response-pipeline" } } } } } } } }

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.15 ms | 404 KiB | 8 Q