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); exit; 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
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/c7VaH
function name:  (null)
number of ops:  36
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
   22     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
          8      > EXIT                                                     
   24     9*       FE_RESET_R                                       $10     !1, ->34
         10*       FE_FETCH_R                                       ~11     $10, !2, ->34
         11*       ASSIGN                                                   !3, ~11
   25    12*       IS_EQUAL                                                 !3, 'settype'
         13*       JMPZ                                                     ~13, ->33
   27    14*       INIT_METHOD_CALL                                         !2, 'attributes'
         15*       DO_FCALL                                      0  $14     
         16*       FETCH_OBJ_R                                      ~15     $14, 'id'
         17*       CAST                                          6  ~16     ~15
         18*       ECHO                                                     ~16
         19*       EXIT                                                     
   28    20*       INIT_FCALL                                               'print_r'
         21*       SEND_VAR                                                 !2
         22*       DO_ICALL                                                 
         23*       EXIT                                                     
   29    24*       FE_RESET_R                                       $18     !2, ->32
         25*       FE_FETCH_R                                       ~19     $18, !4, ->32
         26*       ASSIGN                                                   !5, ~19
   31    27*       INIT_FCALL                                               'print_r'
         28*       SEND_VAR                                                 !4
         29*       DO_ICALL                                                 
         30*       EXIT                                                     
   29    31*       JMP                                                      ->25
         32*       FE_FREE                                                  $18
   24    33*       JMP                                                      ->10
         34*       FE_FREE                                                  $10
   34    35*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.15 ms | 1400 KiB | 17 Q