3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keys = array(0, "", "0", 0.0, false, null, array()); foreach ($keys as $key) { $array = array($key => "foo"); var_dump($key); var_dump(key($array)); var_dump(isset($array[$key])); var_dump(array_key_exists($key, $array)); echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 24
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/vltnn
function name:  (null)
number of ops:  26
compiled vars:  !0 = $keys, !1 = $key, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1      > FE_RESET_R                                       $4      !0, ->24
          2    > > FE_FETCH_R                                               $4, !1, ->24
    4     3    >   INIT_ARRAY                                       ~5      'foo', !1
          4        ASSIGN                                                   !2, ~5
    5     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    6     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'key'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                                 
    7    14        INIT_FCALL                                               'var_dump'
         15        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !2, !1
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                                 
    8    18        INIT_FCALL                                               'var_dump'
         19        ARRAY_KEY_EXISTS                                 ~12     !1, !2
         20        SEND_VAL                                                 ~12
         21        DO_ICALL                                                 
    9    22        ECHO                                                     '%0A'
    3    23      > JMP                                                      ->2
         24    >   FE_FREE                                                  $4
   10    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.23 ms | 1400 KiB | 17 Q