3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(){ try { throw new Exception('Foo'); } finally { $a = new Exception("Test"); $b = new Exception("Test2"); throw new Exception("test3"); } } 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/GEtlU
function name:  (null)
number of ops:  11
compiled vars:  !0 = $exception, !1 = $actualPrevious
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->10
   19     3  E > > CATCH                                       last         'Exception'
   20     4    >   INIT_METHOD_CALL                                         !0, 'getPrevious'
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !1, $3
   21     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   22    10    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/GEtlU
function name:  foo
number of ops:  20
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $3      'Exception'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $3
    8     4*       FAST_CALL                                                ->6
          5*       JMP                                                      ->19
    9     6*       NEW                                              $5      'Exception'
          7*       SEND_VAL_EX                                              'Test'
          8*       DO_FCALL                                      0          
          9*       ASSIGN                                                   !0, $5
   10    10*       NEW                                              $8      'Exception'
         11*       SEND_VAL_EX                                              'Test2'
         12*       DO_FCALL                                      0          
         13*       ASSIGN                                                   !1, $8
   11    14*       NEW                                              $11     'Exception'
         15*       SEND_VAL_EX                                              'test3'
         16*       DO_FCALL                                      0          
         17*       THROW                                         0          $11
         18*       FAST_RET                                                 
   14    19*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.48 ms | 1399 KiB | 16 Q