3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'id' => 1, 'pid' => 1, 'name' => 'admin', 'children' => [ 'id' => 158, 'pid' => 1, 'name' => '000c', 'children' => [ ['id' => 93, 'pid' => 72, 'name' => '000c11'], ['id' => 96, 'pid' => 72, 'name' => '000c12'], ] ] ] ]; $arr = []; array_walk_recursive($array, function($v, $k, &$arr) { if($k === "name") $arr[] = $v; }, $arr); $arr = array_reverse($arr); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bo3lv
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   18     1        ASSIGN                                                   !1, <array>
   19     2        INIT_FCALL                                               'array_walk_recursive'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fbo3lv%3A19%240'
   21     5        SEND_VAL                                                 ~4
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   22     8        INIT_FCALL                                               'array_reverse'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !1, $6
   23    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fbo3lv%3A19%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/bo3lv
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   20     3        IS_IDENTICAL                                             !1, 'name'
          4      > JMPZ                                                     ~3, ->7
          5    >   ASSIGN_DIM                                               !2
          6        OP_DATA                                                  !0
   21     7    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fbo3lv%3A19%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.65 ms | 1387 KiB | 19 Q