3v4l.org

run code in 300+ PHP versions simultaneously
<?php $caught = 0; try { echo 'one', "\n"; throw new Exception('-error1-'); a: echo 'two', "\n"; throw new Exception('-error2-'); } catch (Exception $e) { echo $e->getMessage(), "\n"; $caught++; if ($caught < 3) { goto a; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HQ1jj
function name:  (null)
number of ops:  24
compiled vars:  !0 = $caught, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
    4     1        ECHO                                                     'one'
          2        ECHO                                                     '%0A'
    5     3        NEW                                              $3      'Exception'
          4        SEND_VAL_EX                                              '-error1-'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $3
    6     7    >   ECHO                                                     'two'
          8        ECHO                                                     '%0A'
    7     9        NEW                                              $5      'Exception'
         10        SEND_VAL_EX                                              '-error2-'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $5
         13*       JMP                                                      ->23
    8    14  E > > CATCH                                       last         'Exception'
    9    15    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         16        DO_FCALL                                      0  $7      
         17        ECHO                                                     $7
         18        ECHO                                                     '%0A'
   10    19        PRE_INC                                                  !0
   11    20        IS_SMALLER                                               !0, 3
         21      > JMPZ                                                     ~9, ->23
   12    22    > > JMP                                                      ->7
   14    23    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.19 ms | 1394 KiB | 13 Q