3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'. '<request><body test2="321" test3="987">'. '<rows><my-row test4="564">'. '<types>'. '<custom>this is the example of the text</custom>'. '<Generic arch="simple">this is the example of the text</Generic>'. '<bold/><italic/><underlined/>'. '</types>'. '</my-row><my-row test5="565"/><test hidden="false" ready="true"/></rows>'. '</body></request>'; $obj = new SimpleXmlIterator($s); function f($xml){ foreach ($obj as $key => $value) { var_dump($key, $value->hasChildren(), $value, '============='); if (get_class($value) == 'SimpleXMLIterator') f($v); } } f($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z82XW
function name:  (null)
number of ops:  9
compiled vars:  !0 = $s, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22+standalone%3D%22yes%22+%3F%3E%3Crequest%3E%3Cbody+test2%3D%22321%22+test3%3D%22987%22%3E%3Crows%3E%3Cmy-row+test4%3D%22564%22%3E%3Ctypes%3E%3Ccustom%3Ethis+is+the+example+of+the+text%3C%2Fcustom%3E%3CGeneric+arch%3D%22simple%22%3Ethis+is+the+example+of+the+text%3C%2FGeneric%3E%3Cbold%2F%3E%3Citalic%2F%3E%3Cunderlined%2F%3E%3C%2Ftypes%3E%3C%2Fmy-row%3E%3Cmy-row+test5%3D%22565%22%2F%3E%3Ctest+hidden%3D%22false%22+ready%3D%22true%22%2F%3E%3C%2Frows%3E%3C%2Fbody%3E%3C%2Frequest%3E'
   12     1        NEW                                              $3      'SimpleXmlIterator'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   21     5        INIT_FCALL                                               'f'
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/Z82XW
function name:  f
number of ops:  21
compiled vars:  !0 = $xml, !1 = $obj, !2 = $value, !3 = $key, !4 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1      > FE_RESET_R                                       $5      !1, ->19
          2    > > FE_FETCH_R                                       ~6      $5, !2, ->19
          3    >   ASSIGN                                                   !3, ~6
   16     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !3
          6        INIT_METHOD_CALL                                         !2, 'hasChildren'
          7        DO_FCALL                                      0  $8      
          8        SEND_VAR                                                 $8
          9        SEND_VAR                                                 !2
         10        SEND_VAL                                                 '%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D'
         11        DO_ICALL                                                 
   17    12        GET_CLASS                                        ~10     !2
         13        IS_EQUAL                                                 ~10, 'SimpleXMLIterator'
         14      > JMPZ                                                     ~11, ->18
         15    >   INIT_FCALL_BY_NAME                                       'f'
         16        SEND_VAR_EX                                              !4
         17        DO_FCALL                                      0          
   15    18    > > JMP                                                      ->2
         19    >   FE_FREE                                                  $5
   19    20      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.91 ms | 1403 KiB | 16 Q