3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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(json_decode(json_encode($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; } }
based on Qu6gN
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.32
Parse error: syntax error, unexpected ';' in /in/SXUhG on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected ';' in /in/SXUhG on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/SXUhG on line 14
Process exited with code 255.