3v4l.org

run code in 500+ PHP versions simultaneously
<?php $v = Array( 'ccrs_date', Array( 'prelim_title_report_date', Array( 'additional_escrow_deposit_date', Array( 'earnest_money_date', Array( 'acceptance_date', Array( 'contract_date', Array( 'prelim_title_report_date' ) ) ) ) ) ) ); function get_zero_index(array $array, &$result = []) { foreach($array as $i => $v) { if ($i === 0 && is_string($v)) { $result[] = $v; } elseif(is_array($v)) { get_zero_index($v, $result); } } return $result; } print_r(get_zero_index($v));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vjERQ
function name:  (null)
number of ops:  8
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   41     1        INIT_FCALL                                                   'print_r'
          2        INIT_FCALL                                                   'get_zero_index'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $2      
          5        SEND_VAR                                                     $2
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Function get_zero_index:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
Branch analysis from position: 9
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/vjERQ
function name:  get_zero_index
number of ops:  23
compiled vars:  !0 = $array, !1 = $result, !2 = $v, !3 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <array>
   31     2      > FE_RESET_R                                           $4      !0, ->20
          3    > > FE_FETCH_R                                           ~5      $4, !2, ->20
          4    >   ASSIGN                                                       !3, ~5
   32     5        IS_IDENTICAL                                         ~7      !3, 0
          6      > JMPZ_EX                                              ~7      ~7, ->9
          7    >   TYPE_CHECK                                       64  ~8      !2
          8        BOOL                                                 ~7      ~8
          9    > > JMPZ                                                         ~7, ->13
   33    10    >   ASSIGN_DIM                                                   !1
         11        OP_DATA                                                      !2
   32    12      > JMP                                                          ->19
   34    13    >   TYPE_CHECK                                      128          !2
         14      > JMPZ                                                         ~10, ->19
   35    15    >   INIT_FCALL_BY_NAME                                           'get_zero_index'
         16        SEND_VAR_EX                                                  !2
         17        SEND_VAR_EX                                                  !1
         18        DO_FCALL                                          0          
   31    19    > > JMP                                                          ->3
         20    >   FE_FREE                                                      $4
   38    21      > RETURN                                                       !1
   39    22*     > RETURN                                                       null

End of function get_zero_index

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
223.23 ms | 2102 KiB | 15 Q