3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['test' => '1', 'test2' => 2, 'test3' => 3]; $filter = ['test', 'test2']; $a = array_intersect_key($a, array_flip($filter)); vardump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nh4lg
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $filter
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_flip'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !0, $5
    8    10        INIT_FCALL_BY_NAME                                       'vardump'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.18 ms | 1394 KiB | 17 Q