3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = array( '2019-09-28' => array ( 'A' =>4, 'B' => 85, 'C' =>200 ), '2019-09-29' => array ( 'A' =>5, 'B' => 83, 'C' =>202 ) ); $result_arr = []; array_walk($myArray,function($value,$key) use (&$result_arr){ foreach($value as $k=> $val){ $result_arr[$k][$key] = $val; } }); print_r($result_arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fJJhm
function name:  (null)
number of ops:  12
compiled vars:  !0 = $myArray, !1 = $result_arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   23     1        ASSIGN                                                   !1, <array>
   24     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
   29     6        SEND_VAL                                                 ~4
   24     7        DO_ICALL                                                 
   31     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/fJJhm
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $value, !1 = $key, !2 = $result_arr, !3 = $val, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   25     3      > FE_RESET_R                                       $5      !0, ->10
          4    > > FE_FETCH_R                                       ~6      $5, !3, ->10
          5    >   ASSIGN                                                   !4, ~6
   26     6        FETCH_DIM_W                                      $8      !2, !4
          7        ASSIGN_DIM                                               $8, !1
          8        OP_DATA                                                  !3
   25     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $5
   29    11      > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.62 ms | 1000 KiB | 15 Q