3v4l.org

run code in 300+ PHP versions simultaneously
<?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); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 32
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 32
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/R6s47
function name:  (null)
number of ops:  34
compiled vars:  !0 = $xmlString, !1 = $xml, !2 = $images, !3 = $image, !4 = $src, !5 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22+standalone%3D%22yes%22+%3F%3E%0A%3CT3FlexForms%3E%0A++++%3Cdata%3E%0A++++++++%3Csheet+index%3D%22options%22%3E%0A++++++++++++%3Clanguage+index%3D%22lDEF%22%3E%0A++++++++++++++++%3Cfield+index%3D%22images%22%3E%0A++++++++++++++++++++%3Cel+index%3D%22el%22%3E%0A++++++++++++++++++++++++%3Csection+index%3D%221%22%3E%0A++++++++++++++++++++++++++++%3CitemType+index%3D%22image%22%3E%0A++++++++++++++++++++++++++++++++%3Cel%3E%0A++++++++++++++++++++++++++++++++++++%3Cfield+index%3D%22src%22%3E%0A++++++++++++++++++++++++++++++++++++++++%3Cvalue+index%3D%22vDEF%22%3Efileadmin%2Fuser_upload%2Ftypo3-multi-language-setup%2Frootlevel-domain-records.png%3C%2Fvalue%3E%0A++++++++++++++++++++++++++++++++++++%3C%2Ffield%3E%0A++++++++++++++++++++++++++++++++++++%3Cfield+index%3D%22caption%22%3E%0A++++++++++++++++++++++++++++++++++++++++%3Cvalue+index%3D%22vDEF%22%3ERoot+level+domain+records%3C%2Fvalue%3E%0A++++++++++++++++++++++++++++++++++++%3C%2Ffield%3E%0A++++++++++++++++++++++++++++++++%3C%2Fel%3E%0A++++++++++++++++++++++++++++%3C%2FitemType%3E%0A++++++++++++++++++++++++++++%3CitemType+index%3D%22_TOGGLE%22%3E0%3C%2FitemType%3E%0A++++++++++++++++++++++++%3C%2Fsection%3E%0A++++++++++++++++++++++++%3Csection+index%3D%222%22%3E%0A++++++++++++++++++++++++++++%3CitemType+index%3D%22image%22%3E%0A++++++++++++++++++++++++++++++++%3Cel%3E%0A++++++++++++++++++++++++++++++++++++%3Cfield+index%3D%22src%22%3E%0A++++++++++++++++++++++++++++++++++++++++%3Cvalue+index%3D%22vDEF%22%3Efileadmin%2Fuser_upload%2Ftypo3-multi-language-setup%2Fprepend-this-domain.png%3C%2Fvalue%3E%0A++++++++++++++++++++++++++++++++++++%3C%2Ffield%3E%0A++++++++++++++++++++++++++++++++++++%3Cfield+index%3D%22caption%22%3E%0A++++++++++++++++++++++++++++++++++++++++%3Cvalue+index%3D%22vDEF%22%3EUncheck+this+option%3A+Always+prepend+this+domain...%3C%2Fvalue%3E%0A++++++++++++++++++++++++++++++++++++%3C%2Ffield%3E%0A++++++++++++++++++++++++++++++++%3C%2Fel%3E%0A++++++++++++++++++++++++++++%3C%2FitemType%3E%0A++++++++++++++++++++++++++++%3CitemType+index%3D%22_TOGGLE%22%3E0%3C%2FitemType%3E%0A++++++++++++++++++++++++%3C%2Fsection%3E%0A++++++++++++++++++++++++%3Csection+index%3D%223%22%3E%0A++++++++++++++++++++++++++++%3CitemType+index%3D%22image%22%3E%0A++++++++++++++++++++++++++++++++%3Cel%3E%0A++++++++++++++++++++++++++++++++++++%3Cfield+index%3D%22src%22%3E%0A++++++++++++++++++++++++++++++++++++++++%3Cvalue+index%3D%22vDEF%22%3Efileadmin%2Fuser_upload%2Ftypo3-multi-language-setup%2Fis-root-of-website.png%3C%2Fvalue%3E%0A++++++++++++++++++++++++++++++++++++%3C%2Ffield%3E%0A++++++++++++++++++++++++++++++++++++%3Cfield+index%3D%22caption%22%3E%0A++++++++++++++++++++++++++++++++++++++++%3Cvalue+index%3D%22vDEF%22%3EThis+must+be+checked%3A+Is+root+of+website%3C%2Fvalue%3E%0A++++++++++++++++++++++++++++++++++++%3C%2Ffield%3E%0A++++++++++++++++++++++++++++++++%3C%2Fel%3E%0A++++++++++++++++++++++++++++%3C%2FitemType%3E%0A++++++++++++++++++++++++++++%3CitemType+index%3D%22_TOGGLE%22%3E0%3C%2FitemType%3E%0A++++++++++++++++++++++++%3C%2Fsection%3E%0A++++++++++++++++++++%3C%2Fel%3E%0A++++++++++++++++%3C%2Ffield%3E%0A++++++++++++%3C%2Flanguage%3E%0A++++++++%3C%2Fsheet%3E%0A++++%3C%2Fdata%3E%0A%3C%2FT3FlexForms%3E'
   56     1        NEW                                              $7      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $7
   57     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2FT3FlexForms%2F%2Fsheet%5B%40index%3D%27options%27%5D%2F%2Ffield%5B%40index%3D%27images%27%5D%2F%2Fsection%2FitemType%5B%40index%3D%27image%27%5D%2Fel'
          7        DO_FCALL                                      0  $10     
          8        ASSIGN                                                   !2, $10
   58     9      > FE_RESET_R                                       $12     !2, ->32
         10    > > FE_FETCH_R                                               $12, !3, ->32
   59    11    >   INIT_FCALL                                               'array_shift'
         12        INIT_METHOD_CALL                                         !3, 'xpath'
         13        SEND_VAL_EX                                              '%2F%2Ffield%5B%40index%3D%27src%27%5D%2Fvalue%2Ftext%28%29'
         14        DO_FCALL                                      0  $13     
         15        SEND_VAR_NO_REF                               0          $13
         16        DO_ICALL                                         $14     
         17        CAST                                          6  ~15     $14
         18        ASSIGN                                                   !4, ~15
   60    19        INIT_FCALL                                               'array_shift'
         20        INIT_METHOD_CALL                                         !3, 'xpath'
         21        SEND_VAL_EX                                              '%2F%2Ffield%5B%40index%3D%27caption%27%5D%2Fvalue%2Ftext%28%29'
         22        DO_FCALL                                      0  $17     
         23        SEND_VAR_NO_REF                               0          $17
         24        DO_ICALL                                         $18     
         25        CAST                                          6  ~19     $18
         26        ASSIGN                                                   !5, ~19
   62    27        CONCAT                                           ~21     !4, '%0A'
         28        ECHO                                                     ~21
   63    29        CONCAT                                           ~22     !5, '%0A'
         30        ECHO                                                     ~22
   58    31      > JMP                                                      ->10
         32    >   FE_FREE                                                  $12
   64    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.74 ms | 1400 KiB | 15 Q