3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_keys_exists($array, ...$keys) { foreach($keys as $key) { if(!array_key_exists($key, $array)) { return false; } } return true; } $_REQUEST['wert1'] = "apfel"; $_REQUEST['wert2'] = "false"; $_REQUEST['wert3'] = "birne"; var_dump((bool) $_REQUEST['wert1'] || $_REQUEST['wert2'] || $_REQUEST['wert3']); var_dump((bool) array_keys_exists($_REQUEST, ['wert1', 'wert2', 'wert3']));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 47) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 17
filename:       /in/r84QU
function name:  (null)
number of ops:  33
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_W                      global              $0      '_REQUEST'
          1        ASSIGN_DIM                                               $0, 'wert1'
          2        OP_DATA                                                  'apfel'
   12     3        FETCH_W                      global              $2      '_REQUEST'
          4        ASSIGN_DIM                                               $2, 'wert2'
          5        OP_DATA                                                  'false'
   13     6        FETCH_W                      global              $4      '_REQUEST'
          7        ASSIGN_DIM                                               $4, 'wert3'
          8        OP_DATA                                                  'birne'
   15     9        INIT_FCALL                                               'var_dump'
         10        FETCH_R                      global              ~6      '_REQUEST'
         11        FETCH_DIM_R                                      ~7      ~6, 'wert1'
         12        BOOL                                             ~8      ~7
         13      > JMPNZ_EX                                         ~8      ~8, ->17
         14    >   FETCH_R                      global              ~9      '_REQUEST'
         15        FETCH_DIM_R                                      ~10     ~9, 'wert2'
         16        BOOL                                             ~8      ~10
         17    > > JMPNZ_EX                                         ~8      ~8, ->21
         18    >   FETCH_R                      global              ~11     '_REQUEST'
         19        FETCH_DIM_R                                      ~12     ~11, 'wert3'
         20        BOOL                                             ~8      ~12
         21    >   SEND_VAL                                                 ~8
         22        DO_ICALL                                                 
   16    23        INIT_FCALL                                               'var_dump'
         24        INIT_FCALL                                               'array_keys_exists'
         25        FETCH_R                      global              ~14     '_REQUEST'
         26        SEND_VAL                                                 ~14
         27        SEND_VAL                                                 <array>
         28        DO_FCALL                                      0  $15     
         29        BOOL                                             ~16     $15
         30        SEND_VAL                                                 ~16
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Function array_keys_exists:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/r84QU
function name:  array_keys_exists
number of ops:  13
compiled vars:  !0 = $array, !1 = $keys, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_VARIADIC                                    !1      
    3     2      > FE_RESET_R                                       $3      !1, ->10
          3    > > FE_FETCH_R                                               $3, !2, ->10
    4     4    >   ARRAY_KEY_EXISTS                                 ~4      !2, !0
          5        BOOL_NOT                                         ~5      ~4
          6      > JMPZ                                                     ~5, ->9
    5     7    >   FE_FREE                                                  $3
          8      > RETURN                                                   <false>
    3     9    > > JMP                                                      ->3
         10    >   FE_FREE                                                  $3
    8    11      > RETURN                                                   <true>
    9    12*     > RETURN                                                   null

End of function array_keys_exists

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.34 ms | 1402 KiB | 16 Q