3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Jump found. Position 1 = 2, Position 2 = 27
Branch analysis from position: 2
Jump found. Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
Jump found. Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 27
Jump found. Position 1 = -2
Branch analysis from position: 27
filename:       /in/vltnn
function name:  (null)
number of ops:  29
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, ->27
         2    > > FE_FETCH_R                                               $4, !1, ->27
   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                       33554432  ~10     !2, !1
        16        SEND_VAL                                                 ~10
        17        DO_ICALL                                                 
   8    18        INIT_FCALL                                               'var_dump'
        19        INIT_FCALL                                               'array_key_exists'
        20        SEND_VAR                                                 !1
        21        SEND_VAR                                                 !2
        22        DO_ICALL                                         $12     
        23        SEND_VAR                                                 $12
        24        DO_ICALL                                                 
   9    25        ECHO                                                     '%0A'
        26      > JMP                                                      ->2
        27    >   FE_FREE                                                  $4
        28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0