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>'; function f($xml, $stack = null){ $s = is_null($stack) ? array() : $stack; foreach ($xml as $key => $value) { $s[$key] = null; print_r(array( 'key' => $key, 'hasChildren' => (bool)$xml->hasChildren(), 'attributes' => $value->attributes(), 'stack' => $s, )); if (get_class($value) == 'SimpleXMLIterator') f($value, $s); } } f(new SimpleXMLIterator($s));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y2kCv
function name:  (null)
number of ops:  8
compiled vars:  !0 = $s
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'
   28     1        INIT_FCALL                                               'f'
          2        NEW                                              $2      'SimpleXMLIterator'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $2
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 33
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 33
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 32
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 33
Branch analysis from position: 9
Branch analysis from position: 33
filename:       /in/Y2kCv
function name:  f
number of ops:  35
compiled vars:  !0 = $xml, !1 = $stack, !2 = $s, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   14     2        TYPE_CHECK                                    2          !1
          3      > JMPZ                                                     ~5, ->6
          4    >   QM_ASSIGN                                        ~6      <array>
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~6      !1
          7    >   ASSIGN                                                   !2, ~6
   15     8      > FE_RESET_R                                       $8      !0, ->33
          9    > > FE_FETCH_R                                       ~9      $8, !3, ->33
         10    >   ASSIGN                                                   !4, ~9
   16    11        ASSIGN_DIM                                               !2, !4
         12        OP_DATA                                                  null
   17    13        INIT_FCALL                                               'print_r'
   18    14        INIT_ARRAY                                       ~12     !4, 'key'
   19    15        INIT_METHOD_CALL                                         !0, 'hasChildren'
         16        DO_FCALL                                      0  $13     
         17        BOOL                                             ~14     $13
         18        ADD_ARRAY_ELEMENT                                ~12     ~14, 'hasChildren'
   20    19        INIT_METHOD_CALL                                         !3, 'attributes'
         20        DO_FCALL                                      0  $15     
         21        ADD_ARRAY_ELEMENT                                ~12     $15, 'attributes'
   21    22        ADD_ARRAY_ELEMENT                                ~12     !2, 'stack'
         23        SEND_VAL                                                 ~12
         24        DO_ICALL                                                 
   23    25        GET_CLASS                                        ~17     !3
         26        IS_EQUAL                                                 ~17, 'SimpleXMLIterator'
         27      > JMPZ                                                     ~18, ->32
         28    >   INIT_FCALL_BY_NAME                                       'f'
         29        SEND_VAR_EX                                              !3
         30        SEND_VAR_EX                                              !2
         31        DO_FCALL                                      0          
   15    32    > > JMP                                                      ->9
         33    >   FE_FREE                                                  $8
   25    34      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.62 ms | 1403 KiB | 16 Q