3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'name' => 'a', 'url' => 'b', ], [ 'no-name' => 'foo', ], [ 'name' => 'c', 'url' => 'd', 'children' => [ [ 'name' => 'e', 'url' => 'f' ] ] ] ]; function recurseAll(&$node) { if (is_array($node)) { if (isset($node['name'])) { // do something with the qualifying array... $node[] = 'push a new element into array level'; } foreach ($node as &$childNode) { recurseAll($childNode); } } } recurseAll($array); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4niP3
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   35     1        INIT_FCALL                                               'recurseall'
          2        SEND_REF                                                 !0
          3        DO_FCALL                                      0          
   36     4        INIT_FCALL                                               'var_export'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function recurseall:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 7
Branch analysis from position: 14
filename:       /in/4niP3
function name:  recurseAll
number of ops:  15
compiled vars:  !0 = $node, !1 = $childNode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~2, ->14
   25     3    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'name'
          4      > JMPZ                                                     ~3, ->7
   27     5    >   ASSIGN_DIM                                               !0
          6        OP_DATA                                                  'push+a+new+element+into+array+level'
   29     7    > > FE_RESET_RW                                      $5      !0, ->13
          8    > > FE_FETCH_RW                                              $5, !1, ->13
   30     9    >   INIT_FCALL_BY_NAME                                       'recurseAll'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
   29    12      > JMP                                                      ->8
         13    >   FE_FREE                                                  $5
   33    14    > > RETURN                                                   null

End of function recurseall

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.12 ms | 1008 KiB | 15 Q