3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=['key'=>'value']; $o=(object)$a; error_reproting(E_ALL); foreach (['key', 'foo'] as $key){ try{ echo "array {$key}\n"; echo $a[$key]."\n"; }catch(Exception $e){ print_r($e); } try{ echo "object {$key}\n"; echo $o->{$key}."\n"; }catch(Exception $e){ print_r($e); } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 33
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 33
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Found catch point at position: 16
Branch analysis from position: 16
2 jumps found. (Code = 107) Position 1 = 17, Position 2 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Found catch point at position: 28
Branch analysis from position: 28
2 jumps found. (Code = 107) Position 1 = 29, Position 2 = -2
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
filename:       /in/kiDd7
function name:  (null)
number of ops:  35
compiled vars:  !0 = $a, !1 = $o, !2 = $key, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        CAST                                          8  ~5      !0
          2        ASSIGN                                                   !1, ~5
    4     3        INIT_FCALL_BY_NAME                                       'error_reproting'
          4        SEND_VAL_EX                                              32767
          5        DO_FCALL                                      0          
    5     6      > FE_RESET_R                                       $8      <array>, ->33
          7    > > FE_FETCH_R                                               $8, !2, ->33
    7     8    >   ROPE_INIT                                     3  ~10     'array+'
          9        ROPE_ADD                                      1  ~10     ~10, !2
         10        ROPE_END                                      2  ~9      ~10, '%0A'
         11        ECHO                                                     ~9
    8    12        FETCH_DIM_R                                      ~12     !0, !2
         13        CONCAT                                           ~13     ~12, '%0A'
         14        ECHO                                                     ~13
         15      > JMP                                                      ->20
    9    16  E > > CATCH                                       last         'Exception'
   10    17    >   INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
   13    20    >   ROPE_INIT                                     3  ~16     'object+'
         21        ROPE_ADD                                      1  ~16     ~16, !2
         22        ROPE_END                                      2  ~15     ~16, '%0A'
         23        ECHO                                                     ~15
   14    24        FETCH_OBJ_R                                      ~18     !1, !2
         25        CONCAT                                           ~19     ~18, '%0A'
         26        ECHO                                                     ~19
         27      > JMP                                                      ->32
   15    28  E > > CATCH                                       last         'Exception'
   16    29    >   INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                                 
    5    32    > > JMP                                                      ->7
         33    >   FE_FREE                                                  $8
   20    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.25 ms | 1400 KiB | 15 Q