3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = <<<XML <ResponseXML> <MembershipCardLists> <MembershipCardInfo> <CardNo>8898990000000083</CardNo> </MembershipCardInfo> <MembershipCardInfo> <CardNo>8898000000000260</CardNo> </MembershipCardInfo> </MembershipCardLists> </ResponseXML> /*<items> <hats> <a id="Chicago BULLS" img="bulls.jpeg" cost="$25.00" /> <b id="Toronto RAPTORS" img="raptors.jpeg" cost="$25.00" /> <c id="Orlando MAGIC" img="magic.jpeg" cost="$25.00" /> </hats> <clothes> <a id="Chicago BULLS 23" img="bullstee.jpeg" cost="$30.00" /> <b id="Toronto RAPTORS 23" img="torontotee.jpeg" cost="$30.00" /> <c id="Orlando MAGIC 23" img="magictee.jpeg" cost="$30.00" /> </clothes> </items>*/ XML; $xml = simplexml_load_string($x); foreach ($xml->children() as $name => $value) { echo "$name: <br />"; foreach ($value->children() as $item) { //echo "$item[id], $item[img], $item[cost]<br />"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 18
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/UB7id
function name:  (null)
number of ops:  22
compiled vars:  !0 = $x, !1 = $xml, !2 = $value, !3 = $name, !4 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%0A%3CResponseXML%3E%0A%09%3CMembershipCardLists%3E%0A++++%09%3CMembershipCardInfo%3E%0A++++++%09%09%3CCardNo%3E8898990000000083%3C%2FCardNo%3E%0A++++%09%3C%2FMembershipCardInfo%3E%0A++++%09%3CMembershipCardInfo%3E%0A++++++%09%09%3CCardNo%3E8898000000000260%3C%2FCardNo%3E%0A++++%09%3C%2FMembershipCardInfo%3E%0A%09%3C%2FMembershipCardLists%3E%0A%3C%2FResponseXML%3E%0A%0A%2F%2A%3Citems%3E%0A%3Chats%3E%0A++++%3Ca+id%3D%22Chicago+BULLS%22+img%3D%22bulls.jpeg%22+cost%3D%22%2425.00%22+%2F%3E%0A++++%3Cb+id%3D%22Toronto+RAPTORS%22+img%3D%22raptors.jpeg%22+cost%3D%22%2425.00%22+%2F%3E%0A++++%3Cc+id%3D%22Orlando+MAGIC%22+img%3D%22magic.jpeg%22+cost%3D%22%2425.00%22+%2F%3E%0A%3C%2Fhats%3E%0A%3Cclothes%3E%0A++++%3Ca+id%3D%22Chicago+BULLS+23%22+img%3D%22bullstee.jpeg%22+cost%3D%22%2430.00%22+%2F%3E%0A++++%3Cb+id%3D%22Toronto+RAPTORS+23%22+img%3D%22torontotee.jpeg%22+cost%3D%22%2430.00%22+%2F%3E%0A++++%3Cc+id%3D%22Orlando+MAGIC+23%22+img%3D%22magictee.jpeg%22+cost%3D%22%2430.00%22+%2F%3E%0A%3C%2Fclothes%3E%0A%3C%2Fitems%3E%2A%2F'
   29     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   31     5        INIT_METHOD_CALL                                         !1, 'children'
          6        DO_FCALL                                      0  $8      
          7      > FE_RESET_R                                       $9      $8, ->20
          8    > > FE_FETCH_R                                       ~10     $9, !2, ->20
          9    >   ASSIGN                                                   !3, ~10
   32    10        NOP                                                      
         11        FAST_CONCAT                                      ~12     !3, '%3A+%3Cbr+%2F%3E'
         12        ECHO                                                     ~12
   33    13        INIT_METHOD_CALL                                         !2, 'children'
         14        DO_FCALL                                      0  $13     
         15      > FE_RESET_R                                       $14     $13, ->18
         16    > > FE_FETCH_R                                               $14, !4, ->18
         17    > > JMP                                                      ->16
         18    >   FE_FREE                                                  $14
   31    19      > JMP                                                      ->8
         20    >   FE_FREE                                                  $9
   36    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.8 ms | 1396 KiB | 15 Q