3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aTest = array(4,"f","_","test"); $aReindexed = array(); array_walk($aTest, function(&$v,$k) use (&$aReindexed) { $kNew = $k+100; $aReindexed[$kNew] = $v; } ); print_r($aReindexed); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jIgLW
function name:  (null)
number of ops:  12
compiled vars:  !0 = $aTest, !1 = $aReindexed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
    8     6        SEND_VAL                                                 ~4
    5     7        DO_ICALL                                                 
   11     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   13    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/jIgLW
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $aReindexed, !3 = $kNew
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    6     3        ADD                                              ~4      !1, 100
          4        ASSIGN                                                   !3, ~4
    7     5        ASSIGN_DIM                                               !2, !3
          6        OP_DATA                                                  !0
    8     7      > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.15 ms | 998 KiB | 15 Q