3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = array('12' => 34); var_dump($x); var_dump(gettype(key($x))); var_dump(array_key_exists(true, $x)); var_dump(array_key_exists(12, $x)); var_dump(array_key_exists('12', $x)); var_dump(array_key_exists(12.0, $x));
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/SHI79
function name:  (null)
number of ops:  42
compiled vars:  !0 = $x
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, <array>
   5     1        INIT_FCALL                                               'var_dump'
         2        SEND_VAR                                                 !0
         3        DO_ICALL                                                 
   6     4        INIT_FCALL                                               'var_dump'
         5        INIT_FCALL                                               'gettype'
         6        INIT_FCALL                                               'key'
         7        SEND_VAR                                                 !0
         8        DO_ICALL                                         $3      
         9        SEND_VAR                                                 $3
        10        DO_ICALL                                         $4      
        11        SEND_VAR                                                 $4
        12        DO_ICALL                                                 
   7    13        INIT_FCALL                                               'var_dump'
        14        INIT_FCALL                                               'array_key_exists'
        15        SEND_VAL                                                 <true>
        16        SEND_VAR                                                 !0
        17        DO_ICALL                                         $6      
        18        SEND_VAR                                                 $6
        19        DO_ICALL                                                 
   8    20        INIT_FCALL                                               'var_dump'
        21        INIT_FCALL                                               'array_key_exists'
        22        SEND_VAL                                                 12
        23        SEND_VAR                                                 !0
        24        DO_ICALL                                         $8      
        25        SEND_VAR                                                 $8
        26        DO_ICALL                                                 
   9    27        INIT_FCALL                                               'var_dump'
        28        INIT_FCALL                                               'array_key_exists'
        29        SEND_VAL                                                 '12'
        30        SEND_VAR                                                 !0
        31        DO_ICALL                                         $10     
        32        SEND_VAR                                                 $10
        33        DO_ICALL                                                 
  10    34        INIT_FCALL                                               'var_dump'
        35        INIT_FCALL                                               'array_key_exists'
        36        SEND_VAL                                                 12
        37        SEND_VAR                                                 !0
        38        DO_ICALL                                         $12     
        39        SEND_VAR                                                 $12
        40        DO_ICALL                                                 
        41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0