3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_only($array, $keys) { return array_intersect_key($array, array_flip((array) $keys)); } $array= array('title'=>'fuck','shit'=>'lol'); print_r(array_only($array,'shit'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iNfvg
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'array_only'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'shit'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function array_only:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iNfvg
function name:  array_only
number of ops:  12
compiled vars:  !0 = $array, !1 = $keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'array_intersect_key'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_flip'
          5        CAST                                          7  ~2      !1
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                         $4      
         10      > RETURN                                                   $4
    5    11*     > RETURN                                                   null

End of function array_only

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.58 ms | 1397 KiB | 20 Q