3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array( 'category_id' => 1, 'children' => array( 'category_id' => 2, 'children' => array( 'category_id' => 3, ) ) ), array( 'category_id' => 4, 'children' => array( 'category_id' => 5, 'children' => array( 'category_id' => 6, ) ) ) ); $iterator = new RecursiveIteratorIterator( new RecursiveArrayIterator($array) ); for($iterator; $iterator->valid(); $iterator->next()) { printf( "Key: %s Value: %s Depth: %s\n", $iterator->key(), $iterator->current(), $iterator->getDepth() ); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 9
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 9
Branch analysis from position: 26
Branch analysis from position: 9
filename:       /in/u5ZPM
function name:  (null)
number of ops:  27
compiled vars:  !0 = $array, !1 = $iterator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   24     1        NEW                                              $3      'RecursiveIteratorIterator'
   25     2        NEW                                              $4      'RecursiveArrayIterator'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $4
          6        DO_FCALL                                      0          
   24     7        ASSIGN                                                   !1, $3
   27     8      > JMP                                                      ->23
   29     9    >   INIT_FCALL                                               'printf'
   30    10        SEND_VAL                                                 'Key%3A+%25s+Value%3A+%25s+Depth%3A+%25s%0A'
   31    11        INIT_METHOD_CALL                                         !1, 'key'
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR                                                 $8
   32    14        INIT_METHOD_CALL                                         !1, 'current'
         15        DO_FCALL                                      0  $9      
         16        SEND_VAR                                                 $9
   33    17        INIT_METHOD_CALL                                         !1, 'getDepth'
         18        DO_FCALL                                      0  $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
   27    21        INIT_METHOD_CALL                                         !1, 'next'
         22        DO_FCALL                                      0          
         23    >   INIT_METHOD_CALL                                         !1, 'valid'
         24        DO_FCALL                                      0  $13     
         25      > JMPNZ                                                    $13, ->9
   35    26    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.13 ms | 1395 KiB | 15 Q