3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowedKeys = array('foo','baz'); $get = array('foo' => 'bar', 'baz' => 'bat'); $post = array('foo' => 'bar', 'baz' => 'bat'); if ((array_keys($get) === $allowedKeys) && (array_keys($post) === $allowedKeys) ) { echo "PASS\n"; } $get['notallowed'] = 'naughty'; if ((array_keys($get) === $allowedKeys) && (array_keys($post) === $allowedKeys) ) { echo "FAIL\n"; } else { echo "PASS\n"; } unset($get['notallowed']); $post['notallowed'] = 'naughty'; if ((array_keys($get) === $allowedKeys) && (array_keys($post) === $allowedKeys) ) { echo "FAIL\n"; } else { echo "PASS\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 46) Position 1 = 39, Position 2 = 44
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 47
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 39, Position 2 = 44
Branch analysis from position: 39
Branch analysis from position: 44
Branch analysis from position: 27
Branch analysis from position: 15
Branch analysis from position: 13
filename:       /in/cm7pr
function name:  (null)
number of ops:  49
compiled vars:  !0 = $allowedKeys, !1 = $get, !2 = $post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    6     3        INIT_FCALL                                               'array_keys'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        IS_IDENTICAL                                     ~7      !0, $6
          7      > JMPZ_EX                                          ~7      ~7, ->13
          8    >   INIT_FCALL                                               'array_keys'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $8      
         11        IS_IDENTICAL                                     ~9      !0, $8
         12        BOOL                                             ~7      ~9
         13    > > JMPZ                                                     ~7, ->15
    7    14    >   ECHO                                                     'PASS%0A'
    9    15    >   ASSIGN_DIM                                               !1, 'notallowed'
         16        OP_DATA                                                  'naughty'
   10    17        INIT_FCALL                                               'array_keys'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $11     
         20        IS_IDENTICAL                                     ~12     !0, $11
         21      > JMPZ_EX                                          ~12     ~12, ->27
         22    >   INIT_FCALL                                               'array_keys'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $13     
         25        IS_IDENTICAL                                     ~14     !0, $13
         26        BOOL                                             ~12     ~14
         27    > > JMPZ                                                     ~12, ->30
   11    28    >   ECHO                                                     'FAIL%0A'
         29      > JMP                                                      ->31
   13    30    >   ECHO                                                     'PASS%0A'
   15    31    >   UNSET_DIM                                                !1, 'notallowed'
   17    32        ASSIGN_DIM                                               !2, 'notallowed'
         33        OP_DATA                                                  'naughty'
   18    34        INIT_FCALL                                               'array_keys'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                         $16     
         37        IS_IDENTICAL                                     ~17     !0, $16
         38      > JMPZ_EX                                          ~17     ~17, ->44
         39    >   INIT_FCALL                                               'array_keys'
         40        SEND_VAR                                                 !2
         41        DO_ICALL                                         $18     
         42        IS_IDENTICAL                                     ~19     !0, $18
         43        BOOL                                             ~17     ~19
         44    > > JMPZ                                                     ~17, ->47
   19    45    >   ECHO                                                     'FAIL%0A'
         46      > JMP                                                      ->48
   21    47    >   ECHO                                                     'PASS%0A'
   22    48    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.19 ms | 1400 KiB | 15 Q