3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array('a'=>'a','b'=>'b','c'=>'c','d' =>'d','e' =>'e'); $array2 = array('a','c','e'); $array = array_filter($array1, function($key) use ($array2) { return in_array($key, $array2); }, ARRAY_FILTER_USE_KEY); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/11JDo
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array1, !1 = $array2, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F11JDo%3A5%240'
          5        BIND_LEXICAL                                             ~5, !1
    7     6        SEND_VAL                                                 ~5
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $6      
    5     9        ASSIGN                                                   !2, $6
    9    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F11JDo%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/11JDo
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $key, !1 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    6     2        INIT_FCALL                                               'in_array'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    7     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F11JDo%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.04 ms | 1395 KiB | 19 Q