3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 0 => [1, 2, 3, 4], 1 => ['one', 'two', 'three', 'four'] ]; $res = []; foreach ($arr[0] as $key => $val){ $res[] = array_column($arr, $key); } var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/vXdvD
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr, !1 = $res, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
    9     2        FETCH_DIM_R                                      ~6      !0, 0
          3      > FE_RESET_R                                       $7      ~6, ->13
          4    > > FE_FETCH_R                                       ~8      $7, !2, ->13
          5    >   ASSIGN                                                   !3, ~8
   10     6        INIT_FCALL                                               'array_column'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $11     
         10        ASSIGN_DIM                                               !1
         11        OP_DATA                                                  $11
    9    12      > JMP                                                      ->4
         13    >   FE_FREE                                                  $7
   13    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.26 ms | 1002 KiB | 15 Q