3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = new stdclass; $x->{"whatever"} = 1337; $x = (array)$x; var_dump($x); //$x = array("42" => 1337); foreach ($x as $key => $value) { var_dump($key); if (!array_key_exists((string)$key, $x)) echo 'wtf'; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 21
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/hsjgl
function name:  (null)
number of ops:  24
compiled vars:  !0 = $x, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'stdclass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    3     3        ASSIGN_OBJ                                               !0, 'whatever'
          4        OP_DATA                                                  1337
    4     5        CAST                                          7  ~7      !0
          6        ASSIGN                                                   !0, ~7
    6     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
    9    10      > FE_RESET_R                                       $10     !0, ->22
         11    > > FE_FETCH_R                                       ~11     $10, !1, ->22
         12    >   ASSIGN                                                   !2, ~11
   11    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
   12    16        CAST                                          6  ~14     !2
         17        ARRAY_KEY_EXISTS                                 ~15     ~14, !0
         18        BOOL_NOT                                         ~16     ~15
         19      > JMPZ                                                     ~16, ->21
   13    20    >   ECHO                                                     'wtf'
    9    21    > > JMP                                                      ->11
         22    >   FE_FREE                                                  $10
   16    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.21 ms | 1395 KiB | 15 Q