3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstr='<mainGroup> <groupHeading type="heading">This is a sample heading</groupHeading> <group type="groupType1"> <title>Title1</title> <date when="0001"></date> </group> <group type="groupType1"> <title>Title2</title> <date when="0002"></date> </group> <group type="groupType2"> <title>Title3</title> <date when="0003"></date> </group> </mainGroup>'; $xml=simplexml_load_string($xmlstr); // now loop through all <groupheading>, we use an xpath-query... foreach ($xml->xpath("//groupheading") as $gh) { echo $gh; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/Vvii3
function name:  (null)
number of ops:  14
compiled vars:  !0 = $xmlstr, !1 = $xml, !2 = $gh
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3CmainGroup%3E%0A++++%3CgroupHeading+type%3D%22heading%22%3EThis+is+a+sample+heading%3C%2FgroupHeading%3E%0A++++%3Cgroup+type%3D%22groupType1%22%3E%0A++++++%3Ctitle%3ETitle1%3C%2Ftitle%3E%0A++++++%3Cdate+when%3D%220001%22%3E%3C%2Fdate%3E%0A++++%3C%2Fgroup%3E%0A%0A++++%3Cgroup+type%3D%22groupType1%22%3E%0A++++++%3Ctitle%3ETitle2%3C%2Ftitle%3E%0A++++++%3Cdate+when%3D%220002%22%3E%3C%2Fdate%3E%0A++++%3C%2Fgroup%3E%0A%0A++++%3Cgroup+type%3D%22groupType2%22%3E%0A++++++%3Ctitle%3ETitle3%3C%2Ftitle%3E%0A++++++%3Cdate+when%3D%220003%22%3E%3C%2Fdate%3E%0A++++%3C%2Fgroup%3E%0A%3C%2FmainGroup%3E'
   20     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   24     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2Fgroupheading'
          7        DO_FCALL                                      0  $6      
          8      > FE_RESET_R                                       $7      $6, ->12
          9    > > FE_FETCH_R                                               $7, !2, ->12
   26    10    >   ECHO                                                     !2
   24    11      > JMP                                                      ->9
         12    >   FE_FREE                                                  $7
   29    13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.82 ms | 1395 KiB | 15 Q