3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(){ try { throw new Exception('Foo'); } finally { throw new Exception('Bar', 0, new Exception("I don't even.")); } } try { foo(); } catch(Exception $exception) { $actualPrevious = $exception->getPrevious(); var_dump($actualPrevious); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 3
Branch analysis from position: 3
2 jumps found. (Code = 107) Position 1 = 4, Position 2 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cCE4I
function name:  (null)
number of ops:  11
compiled vars:  !0 = $exception, !1 = $actualPrevious
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->10
   17     3  E > > CATCH                                       last         'Exception'
   18     4    >   INIT_METHOD_CALL                                         !0, 'getPrevious'
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !1, $3
   19     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   20    10    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/cCE4I
function name:  foo
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $1      'Exception'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $1
    8     4*       FAST_CALL                                                ->6
          5*       JMP                                                      ->16
    9     6*       NEW                                              $3      'Exception'
          7*       SEND_VAL_EX                                              'Bar'
          8*       SEND_VAL_EX                                              0
          9*       NEW                                              $4      'Exception'
         10*       SEND_VAL_EX                                              'I+don%27t+even.'
         11*       DO_FCALL                                      0          
         12*       SEND_VAR_NO_REF_EX                                       $4
         13*       DO_FCALL                                      0          
         14*       THROW                                         0          $3
         15*       FAST_RET                                                 
   12    16*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.25 ms | 1390 KiB | 16 Q