3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = [ ['brand' => 'a', 'model' => 'a', 'foo' => 'bar'], ['brand' => 'b', 'model' => 'b', 'foo' => 'b'], ['brand' => 'c', 'model' => 'c', 'foo' => 'c'], ['brand' => 'd', 'model' => 'd', 'foo' => 'd'], ['brand' => 'e', 'model' => 'e', 'foo' => 'e'], ]; $data = array_map(function($item) { return [ 'brand' => $item['brand'], 'model' => $item['model'] ]; }, $data); var_dump($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WvvMp
function name:  (null)
number of ops:  11
compiled vars:  !0 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        INIT_FCALL                                                   'array_map'
          2        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   16     3        SEND_VAL                                                     ~2
          4        SEND_VAR                                                     !0
   11     5        DO_ICALL                                             $3      
          6        ASSIGN                                                       !0, $3
   18     7        INIT_FCALL                                                   'var_dump'
          8        SEND_VAR                                                     !0
          9        DO_ICALL                                                     
         10      > 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/WvvMp
function name:  {closure:/in/WvvMp:11}
number of ops:  7
compiled vars:  !0 = $item
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
   13     1        FETCH_DIM_R                                          ~1      !0, 'brand'
          2        INIT_ARRAY                                           ~2      ~1, 'brand'
   14     3        FETCH_DIM_R                                          ~3      !0, 'model'
          4        ADD_ARRAY_ELEMENT                                    ~2      ~3, 'model'
          5      > RETURN                                                       ~2
   16     6*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.89 ms | 2239 KiB | 15 Q