3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><Body><Response TID="c4ed40a4-8e91-46ee-b571-9ace4c47f642" xmlns:ns="http://wsg.avis.com/wsbang"><OTA_VehResRS xsi:schemaLocation="http://www.opentravel.org/OTA/2008/05 OTA_VehResRS" EchoToken="CT" Target="Production" Version="1.0" SequenceNmbr="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opentravel.org/OTA/2003/05"><Success/><VehResRSCore><VehReservation><VehSegmentCore><Vendor>Budget</Vendor></VehSegmentCore></VehReservation></VehResRSCore><Errors><Error Type="3" ShortText="30212 BizRule">Invalid Value for payment amount</Error></Errors></OTA_VehResRS><!-- Processed by Direct Connect ver. 12.0 build 0 --></Response></Body></Envelope>'; $objXml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA); $rootelement = $objXml->getName(); $hello[$rootelement] = json_decode(json_encode($objXml), TRUE); var_dump($hello);

preferences:
54.05 ms | 402 KiB | 5 Q