3v4l.org

run code in 300+ PHP versions simultaneously
<?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()."\r\n--\r\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 = 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 = 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/UvUE4
function name:  (null)
number of ops:  24
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, ->22
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->22
          3    >   ASSIGN                                                   !2, ~6
    5     4        IS_EQUAL                                                 !1, 2
          5      > JMPZ                                                     ~8, ->11
    6     6    >   NEW                                              $9      'Exception'
          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                                                      ->21
   10    16  E > > CATCH                                       last         'Exception'
   11    17    >   INIT_METHOD_CALL                                         !3, 'getMessage'
         18        DO_FCALL                                      0  $15     
         19        CONCAT                                           ~16     $15, '%0D%0A--%0D%0A'
         20        ECHO                                                     ~16
    3    21    > > JMP                                                      ->2
         22    >   FE_FREE                                                  $5
   13    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.26 ms | 1395 KiB | 13 Q