3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1, 2, 3, 4]; $callable = function($value, $key, array $output) { $output[$key] = $value * 100; }; $output = []; array_map($callable, $array, array_keys($array), $output); print_r($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lA6ns
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $callable, !2 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FlA6ns%3A4%240'
          2        ASSIGN                                                   !1, ~4
    8     3        ASSIGN                                                   !2, <array>
    9     4        INIT_FCALL                                               'array_map'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !0
          7        INIT_FCALL                                               'array_keys'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
   11    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FlA6ns%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lA6ns
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $value, !1 = $key, !2 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    5     3        MUL                                              ~4      !0, 100
          4        ASSIGN_DIM                                               !2, !1
          5        OP_DATA                                                  ~4
    6     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FlA6ns%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
200.04 ms | 1395 KiB | 19 Q