3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = [ 'a' => 1, 'b' => 2, 'c' => 3, ]; $mapping = [ 'x' => 'a', 'y' => 'b', 'z' => 'c', ]; $combined = array_map(function ($key) use ($values) { return $values[$key]; }, $mapping); var_dump($combined);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SBqsv
function name:  (null)
number of ops:  13
compiled vars:  !0 = $values, !1 = $mapping, !2 = $combined
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   15     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FSBqsv%3A15%240'
          4        BIND_LEXICAL                                             ~5, !0
   17     5        SEND_VAL                                                 ~5
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
   15     8        ASSIGN                                                   !2, $6
   19     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FSBqsv%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SBqsv
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $key, !1 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   16     2        FETCH_DIM_R                                      ~2      !1, !0
          3      > RETURN                                                   ~2
   17     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FSBqsv%3A15%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.86 ms | 1399 KiB | 17 Q