3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowedKeys = array("a","b","c"); $test = array("a" => "asdf", "c" => "asdf", "d" => "asdf"); $notAllowedKeys = array_diff(array_keys($test), $allowedKeys); if($notAllowedKeys) { print "One or more keys are not allowed"; print_r($notAllowedKeys); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/hi2sP
function name:  (null)
number of ops:  16
compiled vars:  !0 = $allowedKeys, !1 = $test, !2 = $notAllowedKeys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'array_diff'
          3        INIT_FCALL                                               'array_keys'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
    6    10      > JMPZ                                                     !2, ->15
    7    11    >   ECHO                                                     'One+or+more+keys+are+not+allowed'
    8    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
   10    15    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.08 ms | 1011 KiB | 16 Q