3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 1, array (1, 2, array ( 1, 2 ) ), array (1, 2, 3), 2, array( 1, array ( 1, array (1, 2) ) ) ); function findActives($array, $path_child=null){ foreach ($array as $key => $unknown ) { $path_child[] = $key; /* if (in_array('2') { $path_child = array($key, "active"); } */ if (is_array($unknown)) { findActives($unknown, $path_child); } } } findActives($array); print_r($path_child);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KJPhI
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array, !1 = $path_child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   30     1        INIT_FCALL                                               'findactives'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   32     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function findactives:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/KJPhI
function name:  findActives
number of ops:  16
compiled vars:  !0 = $array, !1 = $path_child, !2 = $unknown, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   19     2      > FE_RESET_R                                       $4      !0, ->14
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->14
          4    >   ASSIGN                                                   !3, ~5
   20     5        ASSIGN_DIM                                               !1
          6        OP_DATA                                                  !3
   24     7        TYPE_CHECK                                  128          !2
          8      > JMPZ                                                     ~8, ->13
   25     9    >   INIT_FCALL_BY_NAME                                       'findActives'
         10        SEND_VAR_EX                                              !2
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
   19    13    > > JMP                                                      ->3
         14    >   FE_FREE                                                  $4
   28    15      > RETURN                                                   null

End of function findactives

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.55 ms | 1403 KiB | 16 Q