3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keywords = [['keyword'=>'designing'],['keyword'=>'logo designing']]; $user_id = 5; array_walk($keywords, fn(&$v, $k, $u) => $v = ['user_id' => $u] + $v, $user_id); var_export($keywords);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/set2j
function name:  (null)
number of ops:  12
compiled vars:  !0 = $keywords, !1 = $user_id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 5
    6     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        SEND_VAL                                                 ~4
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    7     8        INIT_FCALL                                               'var_export'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         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/set2j
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        INIT_ARRAY                                       ~3      !2, 'user_id'
          4        ADD                                              ~4      ~3, !0
          5        ASSIGN                                           ~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:
153.8 ms | 1005 KiB | 15 Q