3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '<?xml version=\"1.0\" encoding=\"UTF-8\"?> <CC_TRANSMISSION CATALOG_ID=\"108639\" NUMBER_OF_ORDERS=\"1\"> <CC_ORDER AMAZON_NO=\"\" INVOICE_NO=\"8265578\" IP_ADDRESS=\"71.119.60.12\" MAYBEBOGUS=\"true\" ORDER_NO=\"7478748\"> <PAYMENT_METHOD> <CREDIT_CARD> <CC_TYPE/> <CC_NUMBER/> <CC_EXPIRATION/> <CC_NAMEONCARD/> <CC_SECURITY_NUMBER/> <CC_ISSUING_BANK/> <CC_ISSUE_NUMBER/> </CREDIT_CARD> </PAYMENT_METHOD> <BILLING_LABEL> <CUSTOMER OK_CONTACT=\"false\" OK_RENT=\"false\"> <CU_CUSTOMER_ID/> <CU_FIRST_NAME>Randi</CU_FIRST_NAME> <CU_LAST_NAME>Caporale</CU_LAST_NAME> <CU_COMPANY/> <CU_PHONE>7609490467</CU_PHONE> <CU_EMAIL/> <CU_SHOPPER_ID>51419162</CU_SHOPPER_ID> <CU_SHOPPER_FLAGS/> <CU_NAME_PREFIX/> <CU_DATE_OF_BIRTH/> </CUSTOMER> <ADDRESS IS_INTERNATIONAL=\"false\"> <AD_ADDRESS1/> <AD_CITY/> <AD_STATE/> <AD_COUNTRY>United States</AD_COUNTRY> <AD_PROVINCE/> <AD_ZIP/> <AD_FLAT/> <AD_ADDRESS2/> <AD_COUNTRY_CODE/> <AD_COMPANY/> </ADDRESS> </BILLING_LABEL> <TOTALS> <TL_ORDER_DATE>05/06/2015 08:09 PM</TL_ORDER_DATE> <TL_SUBTOTAL>$31.45</TL_SUBTOTAL> <TL_TAX>$0.00</TL_TAX> <TL_SHIPPING>$9.25</TL_SHIPPING> <TL_EXCISETAX>$0.00</TL_EXCISETAX> <TL_TOTAL>$40.70</TL_TOTAL> <TL_TAX_RATE>0.0</TL_TAX_RATE> </TOTALS> <ITEMS> <ITEM> <IT_PURCHASE_ID>11590654</IT_PURCHASE_ID> <IT_SKU>1990s-retro-candy-gift-box</IT_SKU> <IT_QUANTITY>1</IT_QUANTITY> <IT_UNIT_PRICE>$31.45</IT_UNIT_PRICE> <IT_SUB_TOTAL>$31.45</IT_SUB_TOTAL> <IT_VID>259286</IT_VID> <SPECIAL_INSTRUCTIONS/> <IT_DESCRIPTION>1990s Retro Candy Gift Box</IT_DESCRIPTION> <PAGE_NUMBER>0</PAGE_NUMBER> <IT_SOURCECODE/> <IT_TAX/> <IT_SHIPPING/> <IT_TRACK_NO/> <IT_EXTENDED_EXCISE_TAX>$0.00</IT_EXTENDED_EXCISE_TAX> </ITEM> <ITEM> <IT_PURCHASE_ID>11590654</IT_PURCHASE_ID> <IT_SKU>1990s-retro-candy-gift-box</IT_SKU> <IT_QUANTITY>1</IT_QUANTITY> <IT_UNIT_PRICE>$31.45</IT_UNIT_PRICE> <IT_SUB_TOTAL>$31.45</IT_SUB_TOTAL> <IT_VID>259286</IT_VID> <SPECIAL_INSTRUCTIONS/> <IT_DESCRIPTION>1990s Retro Candy Gift Box</IT_DESCRIPTION> <PAGE_NUMBER>0</PAGE_NUMBER> <IT_SOURCECODE/> <IT_TAX/> <IT_SHIPPING/> <IT_TRACK_NO/> <IT_EXTENDED_EXCISE_TAX>$0.00</IT_EXTENDED_EXCISE_TAX> </ITEM> </ITEMS> <SHIPPING_LABEL> <CUSTOMER OK_CONTACT=\"false\" OK_RENT=\"false\"> <CU_CUSTOMER_ID/> <CU_FIRST_NAME>Randi</CU_FIRST_NAME> <CU_LAST_NAME>Caporale</CU_LAST_NAME> <CU_COMPANY/> <CU_PHONE>7609490467</CU_PHONE> <CU_EMAIL>randi@candycrate.com</CU_EMAIL> <CU_SHOPPER_ID>51419162</CU_SHOPPER_ID> <CU_SHOPPER_FLAGS/> <CU_NAME_PREFIX/> <CU_DATE_OF_BIRTH/> </CUSTOMER> <ADDRESS IS_INTERNATIONAL=\"false\"> <AD_ADDRESS1>17229 Lemon St</AD_ADDRESS1> <AD_CITY>Hesperia</AD_CITY> <AD_STATE>CA</AD_STATE> <AD_COUNTRY>United States</AD_COUNTRY> <AD_PROVINCE/> <AD_ZIP>92345</AD_ZIP> <AD_FLAT/> <AD_ADDRESS2>Unit A1</AD_ADDRESS2> <AD_COUNTRY_CODE>US</AD_COUNTRY_CODE> <AD_COMPANY/> </ADDRESS> <SL_METHOD>Standard</SL_METHOD> </SHIPPING_LABEL> <GIFT_CARD> <GF_FROM/> <GF_TO/> <GF_DELIV_DATE/> <GF_MESSAGE/> <GF_GREETING/> </GIFT_CARD> <MULTIPLE_PAYMENTS_QTY>0</MULTIPLE_PAYMENTS_QTY> <SHOPPER_COMMENTS/> </CC_ORDER> </CC_TRANSMISSION>'; $xml = simplexml_load_string(stripslashes($str)); echo '<pre>'; //print_r($xml); $ordV = $xml->CC_ORDER; if (is_array($ordV->ITEMS->ITEM)) $itemsV = $ordV->ITEMS->ITEM; else $itemsV[0] = $ordV->ITEMS->ITEM; print_r($ordV->ITEMS->ITEM); ?>
based on cJHs3
Output for 5.0.0 - 7.2.0
<pre>SimpleXMLElement Object ( [IT_PURCHASE_ID] => 11590654 [IT_SKU] => 1990s-retro-candy-gift-box [IT_QUANTITY] => 1 [IT_UNIT_PRICE] => $31.45 [IT_SUB_TOTAL] => $31.45 [IT_VID] => 259286 [SPECIAL_INSTRUCTIONS] => SimpleXMLElement Object ( ) [IT_DESCRIPTION] => 1990s Retro Candy Gift Box [PAGE_NUMBER] => 0 [IT_SOURCECODE] => SimpleXMLElement Object ( ) [IT_TAX] => SimpleXMLElement Object ( ) [IT_SHIPPING] => SimpleXMLElement Object ( ) [IT_TRACK_NO] => SimpleXMLElement Object ( ) [IT_EXTENDED_EXCISE_TAX] => $0.00 )
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/WU14P on line 123
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/WU14P on line 123
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/WU14P on line 123