3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'a' => ['page' => 'page1', 'name' => 'pagename1'], 'b' => ['page' => 'page2', 'name' => 'pagename2'], 'c' => ['page' => 'page3', 'name' => 'pagename3'], 'd' => ['page' => 'page4',], ]; $colName = 'name'; $result = []; array_walk_recursive( $array, function ($v, $k) use ($colName, &$result) { if ($k === $colName) { $result[] = $v; } } ); var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NUXiX
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array, !1 = $colName, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, 'name'
   12     2        ASSIGN                                                   !2, <array>
   13     3        INIT_FCALL                                               'array_walk_recursive'
   14     4        SEND_REF                                                 !0
   15     5        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
          6        BIND_LEXICAL                                             ~6, !1
          7        BIND_LEXICAL                                             ~6, !2
   19     8        SEND_VAL                                                 ~6
   13     9        DO_ICALL                                                 
   21    10        INIT_FCALL                                               'var_export'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
         13      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/NUXiX
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $v, !1 = $k, !2 = $colName, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
   16     4        IS_IDENTICAL                                             !1, !2
          5      > JMPZ                                                     ~4, ->8
   17     6    >   ASSIGN_DIM                                               !3
          7        OP_DATA                                                  !0
   19     8    > > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.7 ms | 1011 KiB | 15 Q