3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = (array) json_decode('{"1":1,"2":1}'); var_dump($array); var_dump(array_key_exists(1, $array)); var_dump(array_key_exists("1", $array)); foreach ($array as $k => $v) { var_dump($k, $v); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 24
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/ACrH6
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $v, !2 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'json_decode'
          1        SEND_VAL                                                     '%7B%221%22%3A1%2C%222%22%3A1%7D'
          2        DO_ICALL                                             $3      
          3        CAST                                              7  ~4      $3
          4        ASSIGN                                                       !0, ~4
    5     5        INIT_FCALL                                                   'var_dump'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                                     
    7     8        INIT_FCALL                                                   'var_dump'
          9        ARRAY_KEY_EXISTS                                     ~7      1, !0
         10        SEND_VAL                                                     ~7
         11        DO_ICALL                                                     
    9    12        INIT_FCALL                                                   'var_dump'
         13        ARRAY_KEY_EXISTS                                     ~9      '1', !0
         14        SEND_VAL                                                     ~9
         15        DO_ICALL                                                     
   11    16      > FE_RESET_R                                           $11     !0, ->24
         17    > > FE_FETCH_R                                           ~12     $11, !1, ->24
         18    >   ASSIGN                                                       !2, ~12
   12    19        INIT_FCALL                                                   'var_dump'
         20        SEND_VAR                                                     !2
         21        SEND_VAR                                                     !1
         22        DO_ICALL                                                     
   11    23      > JMP                                                          ->17
         24    >   FE_FREE                                                      $11
   13    25      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.14 ms | 3034 KiB | 15 Q