3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = <<<XML <DATAPACKET Version="2.0"> <METADATA> <FIELDS> <FIELD attrname="A_ARTICULO__NOMBRE" fieldtype="string" required="true" WIDTH="200"/> <FIELD attrname="A_ARTICULO__REFERENCIA" fieldtype="string" required="true" WIDTH="30"/> <FIELD attrname="APLICAR_RETENCION" fieldtype="i2" required="true"/> <FIELD attrname="CANTIDAD_PENDIENTE" fieldtype="fixedFMT" required="true" DECIMALS="4" WIDTH="19"/> <FIELD attrname="CANTIDAD_SERVIDA" fieldtype="fixedFMT" required="true" DECIMALS="4" WIDTH="19"/> <FIELD attrname="CANTIDAD" fieldtype="fixedFMT" required="true" DECIMALS="4" WIDTH="19"/> <FIELD attrname="DESCRIPCION" fieldtype="bin.hex" SUBTYPE="Text" WIDTH="8"/> <FIELD attrname="DESCUENTO1" fieldtype="fixedFMT" required="true" DECIMALS="4" WIDTH="19"/> <FIELD attrname="DIVISA_VALOR" fieldtype="r8" required="true"/> <FIELD attrname="FECHA_ENTREGA" fieldtype="date"/> <FIELD attrname="IMPORTE" fieldtype="fixedFMT" required="true" DECIMALS="2" WIDTH="19"/> <FIELD attrname="ORDEN_LINEA" fieldtype="i4" required="true"/> <FIELD attrname="PRECIO" fieldtype="fixedFMT" required="true" DECIMALS="6" WIDTH="19"/> <FIELD attrname="TIPO_IVA" fieldtype="fixedFMT" required="true" DECIMALS="2" WIDTH="19"/> <FIELD attrname="ID_LINEA_PEDIDO_VENTA" fieldtype="string" WIDTH="90"/> <FIELD attrname="ID_ALMACEN" fieldtype="string" WIDTH="90"/> <FIELD attrname="ID_ARTICULO" fieldtype="string" WIDTH="90"/> <FIELD attrname="ID_PEDIDO_VENTA" fieldtype="string" WIDTH="90"/> </FIELDS> <PARAMS/> </METADATA> <ROWDATA> <ROW A_ARTICULO__NOMBRE="MOCHILA CA." A_ARTICULO__REFERENCIA="09999601MA" APLICAR_RETENCION="0" CANTIDAD_PENDIENTE="0.0000" CANTIDAD_SERVIDA="0.0000" CANTIDAD="1.0000" DESCUENTO1="0.0000" DIVISA_VALOR="1." FECHA_ENTREGA="20140413" IMPORTE="44.90" ORDEN_LINEA="1" PRECIO="44.900000" TIPO_IVA="21.00" ID_ALMACEN="CENTRAL" ID_ARTICULO="09999601MA" ID_PEDIDO_VENTA="A,5010"/> </ROWDATA> </DATAPACKET> XML; $xml = simplexml_load_string($x); foreach ($xml->ROWDATA->ROW as $row) { echo $row['A_ARTICULO__REFERENCIA'] ; }
based on Kac3e
Output for 5.0.0 - 7.3.0rc6
09999601MA
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/ga5q8 on line 33
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/ga5q8 on line 33
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: simplexml_load_string() in /in/ga5q8 on line 34
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/ga5q8 on line 33