3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'a' => [ 'a' => [ 'a' => null, 'b' => null ], 'b' => [ 'a' => null, 'b' => null ] ], 'b' => [ 'a' => [ 'a' => null, 'b' => null ], 'b' => [ 'a' => null, 'b' => null ] ] ]; function getKeyPaths(array $array, string $prefix = ''): string { return implode( ',', array_map( fn($k, $v) => is_array($v) ? getKeyPaths($v, "$prefix$k") : "$prefix$k", array_keys($array), $array ) ); } var_export(getKeyPaths($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mq9QN
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>
   36     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'getkeypaths'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function getkeypaths:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mq9QN
function name:  getKeyPaths
number of ops:  20
compiled vars:  !0 = $array, !1 = $prefix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
   28     2        INIT_FCALL                                               'implode'
   29     3        SEND_VAL                                                 '%2C'
   30     4        INIT_FCALL                                               'array_map'
   31     5        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          6        BIND_LEXICAL                                             ~2, !1
          7        SEND_VAL                                                 ~2
   32     8        INIT_FCALL                                               'array_keys'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        SEND_VAR                                                 !0
   30    13        DO_ICALL                                         $4      
   32    14        SEND_VAR                                                 $4
   28    15        DO_ICALL                                         $5      
   32    16        VERIFY_RETURN_TYPE                                       $5
         17      > RETURN                                                   $5
   35    18*       VERIFY_RETURN_TYPE                                       
         19*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mq9QN
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $k, !1 = $v, !2 = $prefix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        TYPE_CHECK                                  128          !1
          4      > JMPZ                                                     ~3, ->13
          5    >   INIT_FCALL_BY_NAME                                       'getKeyPaths'
          6        SEND_VAR_EX                                              !1
          7        NOP                                                      
          8        FAST_CONCAT                                      ~4      !2, !0
          9        SEND_VAL_EX                                              ~4
         10        DO_FCALL                                      0  $5      
         11        QM_ASSIGN                                        ~6      $5
         12      > JMP                                                      ->16
         13    >   NOP                                                      
         14        FAST_CONCAT                                      ~7      !2, !0
         15        QM_ASSIGN                                        ~6      ~7
         16    > > RETURN                                                   ~6
         17*     > RETURN                                                   null

End of Dynamic Function 0

End of function getkeypaths

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.96 ms | 1447 KiB | 18 Q