3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array('x' => 1, 'y' => 2, 'z' => 3, 'a' => 4, 'b' => 4); $b = array('x', 'z', 'a'); $result = array_intersect_key($a, array_fill_keys($b, 1)); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/387kO
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_intersect_key'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_fill_keys'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !2, $6
    8    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.5 ms | 1394 KiB | 19 Q