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; while ($foo = $foo->getPrevious()) { $previous++; echo "Previous $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 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 25
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 25
Branch analysis from position: 37
Branch analysis from position: 25
filename:       /in/0OZsl
function name:  (null)
number of ops:  38
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                                                      ->37
   17    22  E > > CATCH                                       last         'Exception'
   18    23    >   ASSIGN                                                   !2, !1
   19    24      > JMP                                                      ->33
   20    25    >   PRE_INC                                                  !3
   21    26        ROPE_INIT                                     3  ~14     'Previous+'
         27        ROPE_ADD                                      1  ~14     ~14, !3
         28        ROPE_END                                      2  ~13     ~14, '%0A'
         29        ECHO                                                     ~13
   22    30        INIT_FCALL                                               'var_dump'
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                                 
   19    33    >   INIT_METHOD_CALL                                         !2, 'getPrevious'
         34        DO_FCALL                                      0  $17     
         35        ASSIGN                                           ~18     !2, $17
         36      > JMPNZ                                                    ~18, ->25
   24    37    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.35 ms | 1400 KiB | 15 Q