3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 10 => 'Windows', 12 => 'Keyboard', 15 => 'Monitor' ]; function map_by_key($m, $n) { return(array('id' => $m, 'name'=>$n)); } $output = array_map("map_by_key", array_keys($array),$array); print '<pre>'; print_r($output); print '</pre>'; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iTVSm
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'array_map'
          2        SEND_VAL                                                 'map_by_key'
          3        INIT_FCALL                                               'array_keys'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
   10    10        ECHO                                                     '%3Cpre%3E'
   11    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
   12    14        ECHO                                                     '%3C%2Fpre%3E'
   13    15      > RETURN                                                   1

Function map_by_key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iTVSm
function name:  map_by_key
number of ops:  6
compiled vars:  !0 = $m, !1 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_ARRAY                                       ~2      !0, 'id'
          3        ADD_ARRAY_ELEMENT                                ~2      !1, 'name'
          4      > RETURN                                                   ~2
    6     5*     > RETURN                                                   null

End of function map_by_key

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.54 ms | 1012 KiB | 16 Q