3v4l.org

run code in 300+ PHP versions simultaneously
<?php $defaults = ['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5]; $optionKeys = array_keys($defaults); $options = $defaults; $args = ['b' => 3, 'e' => 7]; array_walk($args, function($value, $key) use ($optionKeys, &$options){ var_dump($value, $key, $optionKeys, $options); if(in_array($key, $optionKeys)){ $options[$key] = $value; } }); print_r($options);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7IrLI
function name:  (null)
number of ops:  18
compiled vars:  !0 = $defaults, !1 = $optionKeys, !2 = $options, !3 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    7     5        ASSIGN                                                   !2, !0
    9     6        ASSIGN                                                   !3, <array>
   11     7        INIT_FCALL                                               'array_walk'
          8        SEND_REF                                                 !3
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7IrLI%3A11%240'
         10        BIND_LEXICAL                                             ~9, !1
         11        BIND_LEXICAL                                             ~9, !2
   16    12        SEND_VAL                                                 ~9
         13        DO_ICALL                                                 
   18    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F7IrLI%3A11%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/7IrLI
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $value, !1 = $key, !2 = $optionKeys, !3 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
   12     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                                 
   13    10        INIT_FCALL                                               'in_array'
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $5      
         14      > JMPZ                                                     $5, ->17
   14    15    >   ASSIGN_DIM                                               !3, !1
         16        OP_DATA                                                  !0
   16    17    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7IrLI%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.44 ms | 1396 KiB | 23 Q