3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xmlString = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <T3FlexForms> <data> <sheet index="options"> <language index="lDEF"> <field index="images"> <el index="el"> <section index="1"> <itemType index="image"> <el> <field index="src"> <value index="vDEF">fileadmin/user_upload/typo3-multi-language-setup/rootlevel-domain-records.png</value> </field> <field index="caption"> <value index="vDEF">Root level domain records</value> </field> </el> </itemType> <itemType index="_TOGGLE">0</itemType> </section> <section index="2"> <itemType index="image"> <el> <field index="src"> <value index="vDEF">fileadmin/user_upload/typo3-multi-language-setup/prepend-this-domain.png</value> </field> <field index="caption"> <value index="vDEF">Uncheck this option: Always prepend this domain...</value> </field> </el> </itemType> <itemType index="_TOGGLE">0</itemType> </section> <section index="3"> <itemType index="image"> <el> <field index="src"> <value index="vDEF">fileadmin/user_upload/typo3-multi-language-setup/is-root-of-website.png</value> </field> <field index="caption"> <value index="vDEF">This must be checked: Is root of website</value> </field> </el> </itemType> <itemType index="_TOGGLE">0</itemType> </section> </el> </field> </language> </sheet> </data> </T3FlexForms>'; $xml = new \SimpleXMLElement($xmlString); $images = $xml->xpath("//T3FlexForms//sheet[@index='options']//field[@index='images']//section/itemType[@index='image']/el"); foreach ($images as $image) { $src = (string) array_shift($image->xpath("//field[@index='src']/value/text()")); $description = (string) array_shift($image->xpath("//field[@index='caption']/value/text()")); echo $src . chr(10); echo $description . chr(10); }
Output for 7.0.0 - 7.2.0
Notice: Only variables should be passed by reference in /in/R6s47 on line 59 Notice: Only variables should be passed by reference in /in/R6s47 on line 60 fileadmin/user_upload/typo3-multi-language-setup/rootlevel-domain-records.png Root level domain records Notice: Only variables should be passed by reference in /in/R6s47 on line 59 Notice: Only variables should be passed by reference in /in/R6s47 on line 60 fileadmin/user_upload/typo3-multi-language-setup/rootlevel-domain-records.png Root level domain records Notice: Only variables should be passed by reference in /in/R6s47 on line 59 Notice: Only variables should be passed by reference in /in/R6s47 on line 60 fileadmin/user_upload/typo3-multi-language-setup/rootlevel-domain-records.png Root level domain records
Output for 5.3.19 - 5.6.28
Strict Standards: Only variables should be passed by reference in /in/R6s47 on line 59 Strict Standards: Only variables should be passed by reference in /in/R6s47 on line 60 fileadmin/user_upload/typo3-multi-language-setup/rootlevel-domain-records.png Root level domain records Strict Standards: Only variables should be passed by reference in /in/R6s47 on line 59 Strict Standards: Only variables should be passed by reference in /in/R6s47 on line 60 fileadmin/user_upload/typo3-multi-language-setup/rootlevel-domain-records.png Root level domain records Strict Standards: Only variables should be passed by reference in /in/R6s47 on line 59 Strict Standards: Only variables should be passed by reference in /in/R6s47 on line 60 fileadmin/user_upload/typo3-multi-language-setup/rootlevel-domain-records.png Root level domain records