3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = [ "3" => [ "id" => 3, "name" => "Lorem", "type" => "pl" ], "2" => [ "id" => 2, "name" => "Ipsum", "type" => "pl" ] ]; $map = [ "6" => "Sit dolor", "4" => "nostrud exercitation ullamco", "3" => "uuntur magni dolores", "2" => "corporis suscipit laboriosam", "7" => "quia non numquam eius modi tempora", ]; var_export( array_map( fn($row) => $row + ['new_key' => $map[$row['id']]], $rows ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OvIet
function name:  (null)
number of ops:  12
compiled vars:  !0 = $rows, !1 = $map
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, <array>
   24     2        INIT_FCALL                                               'var_export'
   25     3        INIT_FCALL                                               'array_map'
   26     4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
          6        SEND_VAL                                                 ~4
   27     7        SEND_VAR                                                 !0
   25     8        DO_ICALL                                         $5      
   27     9        SEND_VAR                                                 $5
   24    10        DO_ICALL                                                 
   29    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/OvIet
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $row, !1 = $map
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !0, 'id'
          3        FETCH_DIM_R                                      ~3      !1, ~2
          4        INIT_ARRAY                                       ~4      ~3, 'new_key'
          5        ADD                                              ~5      !0, ~4
          6      > RETURN                                                   ~5
          7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.35 ms | 1011 KiB | 15 Q