3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( 'field1' => 1, 'field2' => 2, 'field3' => 3, 'field4' => 4 ); $filter = array('field2', 'field3'); $filtered = array_intersect_key($data, array_flip($filter)); var_dump($filtered);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/61HTK
function name:  (null)
number of ops:  14
compiled vars:  !0 = $data, !1 = $filter, !2 = $filtered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'array_intersect_key'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_flip'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
   13    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.07 ms | 1394 KiB | 19 Q