3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<XML <sets> <settype type="hr" paletteid="2" mand_m_0="0" mand_f_0="0" mand_m_1="0" mand_f_1="0"> <set id="175" gender="M" club="0" colorable="0" selectable="0" preselectable="0"> <part id="996" type="hr" colorable="0" index="0" colorindex="0"/> </set> </settype> <settype type="ch" paletteid="3" mand_m_0="1" mand_f_0="1" mand_m_1="0" mand_f_1="1"> <set id="680" gender="F" club="0" colorable="1" selectable="1" preselectable="0"> <part id="17" type="ch" colorable="1" index="0" colorindex="1"/> <part id="17" type="ls" colorable="1" index="0" colorindex="1"/> <part id="17" type="rs" colorable="1" index="0" colorindex="1"/> </set> </settype> </sets> XML; $xml = simplexml_load_string($string); //print_r($xml); foreach($xml as $a => $b) { if($a == 'settype') { echo (string)$b->attributes()->id; exit; print_r($b); exit; foreach($b as $c => $d) { print_r($d); exit; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 30
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 30
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 29
Branch analysis from position: 10
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/KFhPJ
function name:  (null)
number of ops:  32
compiled vars:  !0 = $string, !1 = $xml, !2 = $b, !3 = $a, !4 = $d, !5 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Csets%3E%0A++++%3Csettype+type%3D%22hr%22+paletteid%3D%222%22+mand_m_0%3D%220%22+mand_f_0%3D%220%22+mand_m_1%3D%220%22+mand_f_1%3D%220%22%3E%0A++++++++%3Cset+id%3D%22175%22+gender%3D%22M%22+club%3D%220%22+colorable%3D%220%22+selectable%3D%220%22+preselectable%3D%220%22%3E%0A++++++++++++%3Cpart+id%3D%22996%22+type%3D%22hr%22+colorable%3D%220%22+index%3D%220%22+colorindex%3D%220%22%2F%3E%0A++++++++%3C%2Fset%3E%0A++++%3C%2Fsettype%3E%0A++++%3Csettype+type%3D%22ch%22+paletteid%3D%223%22+mand_m_0%3D%221%22+mand_f_0%3D%221%22+mand_m_1%3D%220%22+mand_f_1%3D%221%22%3E%0A++++++++%3Cset+id%3D%22680%22+gender%3D%22F%22+club%3D%220%22+colorable%3D%221%22+selectable%3D%221%22+preselectable%3D%220%22%3E%0A++++++++++++%3Cpart+id%3D%2217%22+type%3D%22ch%22+colorable%3D%221%22+index%3D%220%22+colorindex%3D%221%22%2F%3E%0A++++++++++++%3Cpart+id%3D%2217%22+type%3D%22ls%22+colorable%3D%221%22+index%3D%220%22+colorindex%3D%221%22%2F%3E%0A++++++++++++%3Cpart+id%3D%2217%22+type%3D%22rs%22+colorable%3D%221%22+index%3D%220%22+colorindex%3D%221%22%2F%3E%0A++++++++%3C%2Fset%3E%0A++++%3C%2Fsettype%3E%0A%3C%2Fsets%3E'
   20     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !1, $7
   24     5      > FE_RESET_R                                       $9      !1, ->30
          6    > > FE_FETCH_R                                       ~10     $9, !2, ->30
          7    >   ASSIGN                                                   !3, ~10
   25     8        IS_EQUAL                                                 !3, 'settype'
          9      > JMPZ                                                     ~12, ->29
   27    10    >   INIT_METHOD_CALL                                         !2, 'attributes'
         11        DO_FCALL                                      0  $13     
         12        FETCH_OBJ_R                                      ~14     $13, 'id'
         13        CAST                                          6  ~15     ~14
         14        ECHO                                                     ~15
         15      > EXIT                                                     
   28    16*       INIT_FCALL                                               'print_r'
         17*       SEND_VAR                                                 !2
         18*       DO_ICALL                                                 
         19*       EXIT                                                     
   29    20*       FE_RESET_R                                       $17     !2, ->28
         21*       FE_FETCH_R                                       ~18     $17, !4, ->28
         22*       ASSIGN                                                   !5, ~18
   31    23*       INIT_FCALL                                               'print_r'
         24*       SEND_VAR                                                 !4
         25*       DO_ICALL                                                 
         26*       EXIT                                                     
   29    27*       JMP                                                      ->21
         28*       FE_FREE                                                  $17
   24    29    > > JMP                                                      ->6
         30    >   FE_FREE                                                  $9
   34    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.93 ms | 1400 KiB | 17 Q