3v4l.org

run code in 300+ PHP versions simultaneously
<?php function map_privileges($value, $key) { return array('name' => $key, 'value' => $value); } $a = array( 'a' => 1, 'b' => 2 ); $privileges = array_map('map_privileges', $a, array_keys($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ljrlb
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $privileges
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'array_map'
          2        SEND_VAL                                                 'map_privileges'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
         10      > RETURN                                                   1

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

End of function map_privileges

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.2 ms | 1395 KiB | 17 Q