3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $t = array(1,2,3); foreach($t as $k => $val) { try { if($val == 2) { throw new Exception('stop '.$k); } echo $k.' '.$val."\r\n"; } catch(Exception $e) { echo $e->getMessage(); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
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/lluIE
function name:  (null)
number of ops:  23
compiled vars:  !0 = $t, !1 = $val, !2 = $k, !3 = $e
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, <array>
   3     1      > FE_RESET_R                                       $5      !0, ->21
         2    > > FE_FETCH_R                                       ~6      $5, !1, ->21
         3    >   ASSIGN                                                   !2, ~6
   5     4        IS_EQUAL                                         ~8      !1, 2
         5      > JMPZ                                                     ~8, ->11
   6     6    >   NEW                                              $9      :-3
         7        CONCAT                                           ~10     'stop+', !2
         8        SEND_VAL_EX                                              ~10
         9        DO_FCALL                                      0          
        10      > THROW                                         0          $9
   8    11    >   CONCAT                                           ~12     !2, '+'
        12        CONCAT                                           ~13     ~12, !1
        13        CONCAT                                           ~14     ~13, '%0D%0A'
        14        ECHO                                                     ~14
        15      > JMP                                                      ->20
  10    16  E > > CATCH                                                    'Exception', !3
  11    17    >   INIT_METHOD_CALL                                         !3, 'getMessage'
        18        DO_FCALL                                      0  $15     
        19        ECHO                                                     $15
        20    > > JMP                                                      ->2
        21    >   FE_FREE                                                  $5
  13    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0