3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { try { throw new Exception('Foo'); } finally { throw new Exception('Bar', 0, null); } } catch(Exception $exception) { var_dump($exception); $actualPrevious = $exception->getPrevious(); var_dump($actualPrevious); }
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 = 62) Position 1 = -2
filename:       /in/9S2Lm
function name:  (null)
number of ops:  25
compiled vars:  !0 = $exception, !1 = $actualPrevious
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $3      'Exception'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $3
    7     4*       FAST_CALL                                                ->6
          5*       JMP                                                      ->13
    8     6*       NEW                                              $5      'Exception'
          7*       SEND_VAL_EX                                              'Bar'
          8*       SEND_VAL_EX                                              0
          9*       SEND_VAL_EX                                              null
         10*       DO_FCALL                                      0          
         11*       THROW                                         0          $5
         12*       FAST_RET                                                 
         13*       JMP                                                      ->24
   11    14  E > > CATCH                                       last         'Exception'
   12    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
   13    18        INIT_METHOD_CALL                                         !0, 'getPrevious'
         19        DO_FCALL                                      0  $8      
         20        ASSIGN                                                   !1, $8
   14    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
   15    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.75 ms | 1395 KiB | 15 Q