3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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); var_dump($objXml); var_dump($objXml->Errors);
based on HcSIi
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0beta1
object(SimpleXMLElement)#1 (1) { ["Body"]=> object(SimpleXMLElement)#2 (1) { ["Response"]=> object(SimpleXMLElement)#3 (3) { ["@attributes"]=> array(1) { ["TID"]=> string(36) "c4ed40a4-8e91-46ee-b571-9ace4c47f642" } ["OTA_VehResRS"]=> object(SimpleXMLElement)#4 (4) { ["@attributes"]=> array(4) { ["EchoToken"]=> string(2) "CT" ["Target"]=> string(10) "Production" ["Version"]=> string(3) "1.0" ["SequenceNmbr"]=> string(1) "0" } ["Success"]=> object(SimpleXMLElement)#6 (0) { } ["VehResRSCore"]=> object(SimpleXMLElement)#7 (1) { ["VehReservation"]=> object(SimpleXMLElement)#9 (1) { ["VehSegmentCore"]=> object(SimpleXMLElement)#10 (1) { ["Vendor"]=> string(6) "Budget" } } } ["Errors"]=> object(SimpleXMLElement)#8 (1) { ["Error"]=> string(32) "Invalid Value for payment amount" } } ["comment"]=> object(SimpleXMLElement)#5 (0) { } } } } object(SimpleXMLElement)#2 (0) { }
Output for hhvm-3.21.3 - 3.22.0
object(SimpleXMLElement)#1 (1) { ["Body"]=> object(SimpleXMLElement)#2 (1) { ["Response"]=> object(SimpleXMLElement)#3 (3) { ["@attributes"]=> array(1) { ["TID"]=> string(36) "c4ed40a4-8e91-46ee-b571-9ace4c47f642" } ["OTA_VehResRS"]=> object(SimpleXMLElement)#4 (4) { ["@attributes"]=> array(4) { ["EchoToken"]=> string(2) "CT" ["Target"]=> string(10) "Production" ["Version"]=> string(3) "1.0" ["SequenceNmbr"]=> string(1) "0" } ["Success"]=> object(SimpleXMLElement)#6 (0) { } ["VehResRSCore"]=> object(SimpleXMLElement)#7 (1) { ["VehReservation"]=> object(SimpleXMLElement)#9 (1) { ["VehSegmentCore"]=> object(SimpleXMLElement)#10 (1) { ["Vendor"]=> string(6) "Budget" } } } ["Errors"]=> object(SimpleXMLElement)#8 (1) { ["Error"]=> string(32) "Invalid Value for payment amount" } } ["comment"]=> object(SimpleXMLElement)#5 (0) { } } } } object(SimpleXMLElement)#10 (0) { }
Output for hhvm-3.18.5
object(SimpleXMLElement)#1 (1) { ["Body"]=> object(SimpleXMLElement)#2 (1) { ["Response"]=> object(SimpleXMLElement)#3 (3) { ["@attributes"]=> array(1) { ["TID"]=> string(36) "c4ed40a4-8e91-46ee-b571-9ace4c47f642" } ["OTA_VehResRS"]=> object(SimpleXMLElement)#4 (4) { ["@attributes"]=> array(4) { ["EchoToken"]=> string(2) "CT" ["Target"]=> string(10) "Production" ["Version"]=> string(3) "1.0" ["SequenceNmbr"]=> string(1) "0" } ["Success"]=> object(SimpleXMLElement)#6 (0) { } ["VehResRSCore"]=> object(SimpleXMLElement)#7 (1) { ["VehReservation"]=> object(SimpleXMLElement)#9 (1) { ["VehSegmentCore"]=> object(SimpleXMLElement)#10 (1) { ["Vendor"]=> string(6) "Budget" } } } ["Errors"]=> object(SimpleXMLElement)#8 (1) { ["Error"]=> string(32) "Invalid Value for payment amount" } } ["comment"]=> object(SimpleXMLElement)#5 (0) { } } } } object(SimpleXMLElement)#9 (0) { }