3v4l.org

run code in 300+ PHP versions simultaneously
<?php $required = ['k1', 'k2']; $data = [ 'k1' => 'v1', 'k2' => 'v2', 'k3' => 'v3', ]; $r = ($required == array_intersect($required, array_keys($data))); var_dump($r);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FpO6Q
function name:  (null)
number of ops:  15
compiled vars:  !0 = $required, !1 = $data, !2 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
   10     2        INIT_FCALL                                               'array_intersect'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        IS_EQUAL                                         ~7      !0, $6
         10        ASSIGN                                                   !2, ~7
   12    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.54 ms | 1385 KiB | 19 Q