3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ ['record' => 1, 'sponsor' => 2, 'email' => 'some@email.com'], ['record' => 2, 'sponsor' => 2, 'email' => 'some1@email.com'], ['record' => 3, 'sponsor' => 2, 'email' => 'some2@email.com'], ['record' => 4, 'sponsor' => 2, 'email' => 'some3@email.com'], ]; $lookup = array_column($array, 'email', 'record'); var_export( array_map(fn($row) => $row += ['sponsor' => $lookup[$row['sponsor']]], $array) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C7Smm
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $lookup
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                                                     'email'
          4        SEND_VAL                                                     'record'
          5        DO_ICALL                                             $3      
          6        ASSIGN                                                       !1, $3
   11     7        INIT_FCALL                                                   'var_export'
   12     8        INIT_FCALL                                                   'array_map'
          9        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
         10        BIND_LEXICAL                                                 ~5, !1
         11        SEND_VAL                                                     ~5
         12        SEND_VAR                                                     !0
         13        DO_ICALL                                             $6      
         14        SEND_VAR                                                     $6
   11    15        DO_ICALL                                                     
   13    16      > 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/C7Smm
function name:  {closure:/in/C7Smm:12}
number of ops:  8
compiled vars:  !0 = $row, !1 = $lookup
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        FETCH_DIM_R                                          ~2      !0, 'sponsor'
          3        FETCH_DIM_R                                          ~3      !1, ~2
          4        INIT_ARRAY                                           ~4      ~3, 'sponsor'
          5        ASSIGN_OP                                         1  ~5      !0, ~4
          6      > RETURN                                                       ~5
          7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.03 ms | 1956 KiB | 16 Q