3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = array('a' => 'b'); function cb($v) { return $v; } function keys($v, $k) { return $k; } print_r(array_map('cb', $ar)); $keys = array_map('keys', $ar, array_keys($ar)); print_r(array_map('cb', $ar, $keys));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gSNgV
function name:  (null)
number of ops:  26
compiled vars:  !0 = $ar, !1 = $keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'cb'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                                 
    8     8        INIT_FCALL                                               'array_map'
          9        SEND_VAL                                                 'keys'
         10        SEND_VAR                                                 !0
         11        INIT_FCALL                                               'array_keys'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                         $6      
         16        ASSIGN                                                   !1, $6
    9    17        INIT_FCALL                                               'print_r'
         18        INIT_FCALL                                               'array_map'
         19        SEND_VAL                                                 'cb'
         20        SEND_VAR                                                 !0
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $8      
         23        SEND_VAR                                                 $8
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Function cb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gSNgV
function name:  cb
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function cb

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

End of function keys

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 1396 KiB | 19 Q