3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 0 => Array ( 'id' => 1, 'column2' => 'value2', 'column3' => 'value3', 'column4' => 'value4', 'column5' => 'value5' ), 1 => Array ( 'id' => 1, 'column2' => 'value2', 'column3' => 'value3', 'column4' => 'value4', 'column5' => 'value5' ), 2 => Array ( 'id' => 2, 'column2' => 'value2', 'column3' => 'value3', 'column4' => 'value4', 'column5' => 'value5' ), ); $keys =array_column($array, 'id'); $new_array = array_map(function($k) use ($array){return $array[$k];}, $keys); print_r($new_array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NvXRL
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $keys, !2 = $new_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'array_column'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'id'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   11     6        INIT_FCALL                                               'array_map'
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNvXRL%3A11%240'
          8        BIND_LEXICAL                                             ~6, !0
          9        SEND_VAL                                                 ~6
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
   12    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FNvXRL%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NvXRL
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $k, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !1, !0
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNvXRL%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.18 ms | 1387 KiB | 19 Q