3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArr = array ( array ( "User" => array ( "id" => 2, "feature" => "AddUser", "feature_level" => 1, "parent_feature" => 1 ) ), array ( "User" => array ( "id" => 3, "feature" => "EditUser", "feature_level" => 1, "parent_feature" => 1 ) ), array ( "Candidate" => array ( "id" => 5, "feature" => "AddCandidate", "feature_level" => 1, "parent_feature" => 4 ) ), array ( "Candidate" => array ( "id" => 6, "feature" => "EditCandidate", "feature_level" => 1, "parent_feature" => 4 ) ) ); $result_arr = []; array_walk($myArr,function($v,$k) use (&$result_arr){ $result_arr[key($v)][] = $v[key($v)]; }); print_r($result_arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3hNjW
function name:  (null)
number of ops:  12
compiled vars:  !0 = $myArr, !1 = $result_arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   55     1        ASSIGN                                                   !1, <array>
   57     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3hNjW%3A57%240'
          5        BIND_LEXICAL                                             ~4, !1
   59     6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   61     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3hNjW%3A57%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3hNjW
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $v, !1 = $k, !2 = $result_arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   57     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   58     3        INIT_FCALL                                               'key'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        INIT_FCALL                                               'key'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        FETCH_DIM_R                                      ~7      !0, $6
         10        FETCH_DIM_W                                      $4      !2, $3
         11        ASSIGN_DIM                                               $4
         12        OP_DATA                                                  ~7
   59    13      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3hNjW%3A57%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.76 ms | 1395 KiB | 19 Q