3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 'name' => 'richard', 'email' => 'richard@gmail.com', 'address' => Array ( 'city' => 'paris', 'zip' => 12121 ), 'address1' => Array ( 'city' => 'paris', 'zip' => 12121 ), 'address3' => Array ( 'city' => 'paris', 'zip' => 12121 ) ); function list_keys($array) { $output = array(); foreach ($array as $k => $v) { if (is_array($v)) { foreach (list_keys($v) as $path) { $output[] = "$k.$path"; } } else { $output[] = $k; } } return $output; } print_r(list_keys($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9tARs
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   41     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'list_keys'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function list_keys:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 23
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/9tARs
function name:  list_keys
number of ops:  26
compiled vars:  !0 = $array, !1 = $output, !2 = $v, !3 = $k, !4 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        ASSIGN                                                   !1, <array>
   28     2      > FE_RESET_R                                       $6      !0, ->23
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->23
          4    >   ASSIGN                                                   !3, ~7
   29     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~9, ->20
   30     7    >   INIT_FCALL_BY_NAME                                       'list_keys'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $10     
         10      > FE_RESET_R                                       $11     $10, ->18
         11    > > FE_FETCH_R                                               $11, !4, ->18
   31    12    >   ROPE_INIT                                     3  ~14     !3
         13        ROPE_ADD                                      1  ~14     ~14, '.'
         14        ROPE_END                                      2  ~13     ~14, !4
         15        ASSIGN_DIM                                               !1
         16        OP_DATA                                                  ~13
   30    17      > JMP                                                      ->11
         18    >   FE_FREE                                                  $11
         19      > JMP                                                      ->22
   35    20    >   ASSIGN_DIM                                               !1
         21        OP_DATA                                                  !3
   28    22    > > JMP                                                      ->3
         23    >   FE_FREE                                                  $6
   38    24      > RETURN                                                   !1
   39    25*     > RETURN                                                   null

End of function list_keys

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.62 ms | 1403 KiB | 16 Q