3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { try { try { throw new Exception('Foo'); } finally { throw new Exception('Bar', 0, null); } } catch (Exception $e) { throw new Exception('Zot', 0, $e); } } catch(Exception $exception) { $foo = $exception; $previous = 0; while ($foo = $foo->getPrevious()) { $previous++; echo "Level $previous\n"; var_dump($foo); } }
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
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 22
Branch analysis from position: 22
2 jumps found. (Code = 107) Position 1 = 23, Position 2 = -2
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 26
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 26
Branch analysis from position: 38
Branch analysis from position: 26
filename:       /in/H3Pe8
function name:  (null)
number of ops:  39
compiled vars:  !0 = $e, !1 = $exception, !2 = $foo, !3 = $previous
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $5      'Exception'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $5
    9     4*       FAST_CALL                                                ->6
          5*       JMP                                                      ->13
   10     6*       NEW                                              $7      'Exception'
          7*       SEND_VAL_EX                                              'Bar'
          8*       SEND_VAL_EX                                              0
          9*       SEND_VAL_EX                                              null
         10*       DO_FCALL                                      0          
         11*       THROW                                         0          $7
         12*       FAST_RET                                                 
         13*       JMP                                                      ->21
   13    14  E > > CATCH                                       last         'Exception'
   14    15    >   NEW                                              $9      'Exception'
         16        SEND_VAL_EX                                              'Zot'
         17        SEND_VAL_EX                                              0
         18        SEND_VAR_EX                                              !0
         19        DO_FCALL                                      0          
         20      > THROW                                         0          $9
         21*       JMP                                                      ->38
   17    22  E > > CATCH                                       last         'Exception'
   18    23    >   ASSIGN                                                   !2, !1
   19    24        ASSIGN                                                   !3, 0
   20    25      > JMP                                                      ->34
   21    26    >   PRE_INC                                                  !3
   22    27        ROPE_INIT                                     3  ~15     'Level+'
         28        ROPE_ADD                                      1  ~15     ~15, !3
         29        ROPE_END                                      2  ~14     ~15, '%0A'
         30        ECHO                                                     ~14
   23    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                                 
   20    34    >   INIT_METHOD_CALL                                         !2, 'getPrevious'
         35        DO_FCALL                                      0  $18     
         36        ASSIGN                                           ~19     !2, $18
         37      > JMPNZ                                                    ~19, ->26
   25    38    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.96 ms | 1400 KiB | 15 Q