3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <ROOT> <HEADER REFNR="0000000003060697" CID="414D51204341535F46525F544553542E3F40FADD206D8D3B" PLANT="3011" KEY="[ORDER]" DIRECT="1" OBJECTTYPE="LOIPRO" DATASTEP="PROMES001 Version001" LASTSTEP="B03" CREDATE="2011-06-21" CRETIME="16:18:33" ACTDATE="2011-06-21" ACTTIME="16:18:44" STATUS="22" TEST="" SYSTAT="1"> <SOURCE NAME="MANUAL" VERSION="001"/> <DESTINATION NAME="MES" VERSION="001"/> </HEADER> <DATA> <SAPMES PLANT="3011"> <LOIPRO> <E1FKOL AUFNR="[ORDER]" MATNR="A2C89902300" GAMNG="[QUANTITY]" GASMG="0.000" GSTRS="[TODAY]" GLTRS="[TODAYPLUS30]" OBJNR="MANUAL_LOIPRO"/> <E1AFPOL POSNR="1" VERID="0001"/> <E1AFFLL PLNFL="0" FLGAT="0"> <E1FVOL VORNR="20" LTXA1="ICT" ARBPL="7280818" ARBID="00000000" STEUS="MMN" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="25" LTXA1="REPARAR" ARBPL="1040091" ARBID="00000000" STEUS="MRNB" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="30" LTXA1="IMPRIME" ARBPL="7280203" ARBID="00000000" STEUS="MON" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="40" LTXA1="SOLMINI" ARBPL="0082002" ARBID="00000000" STEUS="MON" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="50" LTXA1="DESPANE" ARBPL="7281501" ARBID="00000000" STEUS="MON" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="60" LTXA1="PEGAR" ARBPL="7280502" ARBID="00000000" STEUS="MON" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="65" LTXA1="REPARAR" ARBPL="1040091" ARBID="00000000" STEUS="MRNB" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="70" LTXA1="FIN" ARBPL="1040090" ARBID="00000000" STEUS="MMN" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> </E1AFFLL> </LOIPRO> </SAPMES> </DATA> </ROOT> XML; $doc = new DOMDocument(); $doc->loadXML($xml); $xp = new DOMXPath($doc); foreach($xp->query('/ROOT/HEADER/@KEY[. != ""]') as $attrib) { $attrib->nodeValue = 'DATA'; } foreach($xp->query('/ROOT/DATA/SAPMES/LOIPRO/E1FKOL/@AUFNR[. != ""]') as $attrib) { $attrib->nodeValue = 'DATA'; } foreach($xp->query('/ROOT/DATA/SAPMES/LOIPRO/E1FKOL/E1AFFLL/@MGVRG[. != ""]') as $attrib) { $attrib->nodeValue = 'NOVO'; } echo $doc->saveXML();
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<?xml version="1.0" encoding="UTF-8"?> <ROOT> <HEADER REFNR="0000000003060697" CID="414D51204341535F46525F544553542E3F40FADD206D8D3B" PLANT="3011" KEY="DATA" DIRECT="1" OBJECTTYPE="LOIPRO" DATASTEP="PROMES001 Version001" LASTSTEP="B03" CREDATE="2011-06-21" CRETIME="16:18:33" ACTDATE="2011-06-21" ACTTIME="16:18:44" STATUS="22" TEST="" SYSTAT="1"> <SOURCE NAME="MANUAL" VERSION="001"/> <DESTINATION NAME="MES" VERSION="001"/> </HEADER> <DATA> <SAPMES PLANT="3011"> <LOIPRO> <E1FKOL AUFNR="DATA" MATNR="A2C89902300" GAMNG="[QUANTITY]" GASMG="0.000" GSTRS="[TODAY]" GLTRS="[TODAYPLUS30]" OBJNR="MANUAL_LOIPRO"/> <E1AFPOL POSNR="1" VERID="0001"/> <E1AFFLL PLNFL="0" FLGAT="0"> <E1FVOL VORNR="20" LTXA1="ICT" ARBPL="7280818" ARBID="00000000" STEUS="MMN" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="25" LTXA1="REPARAR" ARBPL="1040091" ARBID="00000000" STEUS="MRNB" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="30" LTXA1="IMPRIME" ARBPL="7280203" ARBID="00000000" STEUS="MON" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="40" LTXA1="SOLMINI" ARBPL="0082002" ARBID="00000000" STEUS="MON" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="50" LTXA1="DESPANE" ARBPL="7281501" ARBID="00000000" STEUS="MON" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="60" LTXA1="PEGAR" ARBPL="7280502" ARBID="00000000" STEUS="MON" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="65" LTXA1="REPARAR" ARBPL="1040091" ARBID="00000000" STEUS="MRNB" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> <E1FVOL VORNR="70" LTXA1="FIN" ARBPL="1040090" ARBID="00000000" STEUS="MMN" MGVRG="[QUANTITY]" MEINH="PCE" BMSCH="100.000" VGE01="MIN" VGE02="MIN" VGE03="MIN" VGW01="0.000" VGW02="0" VGW03="0"/> </E1AFFLL> </LOIPRO> </SAPMES> </DATA> </ROOT>
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/RQS2Z on line 32
Process exited with code 255.
Output for 4.4.2
Fatal error: Cannot instantiate non-existent class: domdocument in /in/RQS2Z on line 33
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/RQS2Z on line 32