3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['a' => 1, 'b' => 'x', 'c' => true], ['b' => 'y', 'a' => '2', 'c' => false], ['c' => null, 'b' => 'z', 'a' => 3] ]; $result = []; array_walk($array, function ($row, $i) use (&$result) { array_walk($row, function ($v, $k) use (&$result, $i) { $result[$k][$i] = $v; }); }); var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fpBLc
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   10     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
   14     6        SEND_VAL                                                 ~4
   10     7        DO_ICALL                                                 
   15     8        INIT_FCALL                                               'var_export'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fpBLc
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $row, !1 = $i, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   11     3        INIT_FCALL                                               'array_walk'
          4        SEND_REF                                                 !0
          5        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          6        BIND_LEXICAL                                             ~3, !2
          7        BIND_LEXICAL                                             ~3, !1
   13     8        SEND_VAL                                                 ~3
   11     9        DO_ICALL                                                 
   14    10      > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fpBLc
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $result, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
   12     4        FETCH_DIM_W                                      $4      !2, !1
          5        ASSIGN_DIM                                               $4, !3
          6        OP_DATA                                                  !0
   13     7      > RETURN                                                   null

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.4 ms | 1002 KiB | 15 Q