3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine' ); foreach ($array as $key => $value) { try { if ($key === 2) { throw new Exception("Key 2 Exception ({$value})"); } echo $value . "\n"; } catch (Exception $e) { echo $e->getMessage() . "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 22
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
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 = 2
Branch analysis from position: 2
filename:       /in/4mfb5
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $value, !2 = $key, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1      > FE_RESET_R                                       $5      !0, ->22
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->22
          3    >   ASSIGN                                                   !2, ~6
   18     4        IS_IDENTICAL                                             !2, 2
          5      > JMPZ                                                     ~8, ->13
   19     6    >   NEW                                              $9      'Exception'
          7        ROPE_INIT                                     3  ~11     'Key+2+Exception+%28'
          8        ROPE_ADD                                      1  ~11     ~11, !1
          9        ROPE_END                                      2  ~10     ~11, '%29'
         10        SEND_VAL_EX                                              ~10
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $9
   21    13    >   CONCAT                                           ~14     !1, '%0A'
         14        ECHO                                                     ~14
         15      > JMP                                                      ->21
   22    16  E > > CATCH                                       last         'Exception'
   23    17    >   INIT_METHOD_CALL                                         !3, 'getMessage'
         18        DO_FCALL                                      0  $15     
         19        CONCAT                                           ~16     $15, '%0A'
         20        ECHO                                                     ~16
   16    21    > > JMP                                                      ->2
         22    >   FE_FREE                                                  $5
   25    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.16 ms | 1395 KiB | 13 Q