3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { try { throw new Exception('Foo'); } finally { throw new Exception('Bar'); } } 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: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kQDW8
function name:  (null)
number of ops:  20
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                                                      ->11
    8     6*       NEW                                              $5      'Exception'
          7*       SEND_VAL_EX                                              'Bar'
          8*       DO_FCALL                                      0          
          9*       THROW                                         0          $5
         10*       FAST_RET                                                 
         11*       JMP                                                      ->19
   11    12  E > > CATCH                                       last         'Exception'
   14    13    >   INIT_METHOD_CALL                                         !0, 'getPrevious'
         14        DO_FCALL                                      0  $7      
         15        ASSIGN                                                   !1, $7
   15    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   16    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.34 ms | 1395 KiB | 15 Q