3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(){ try { throw new Exception('Foo'); } finally { $a = new Exception("Test"); var_dump($a->getPrevious()); $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 = 4
Branch analysis from position: 4
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
filename:       /in/XoRjk
function name:  (null)
number of ops:  5
compiled vars:  !0 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->4
   20     3  E > > CATCH                                       last         'Exception'
   23     4    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/XoRjk
function name:  foo
number of ops:  25
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                                                      ->24
    9     6*       NEW                                              $5      'Exception'
          7*       SEND_VAL_EX                                              'Test'
          8*       DO_FCALL                                      0          
          9*       ASSIGN                                                   !0, $5
   10    10*       INIT_FCALL                                               'var_dump'
         11*       INIT_METHOD_CALL                                         !0, 'getPrevious'
         12*       DO_FCALL                                      0  $8      
         13*       SEND_VAR                                                 $8
         14*       DO_ICALL                                                 
   11    15*       NEW                                              $10     'Exception'
         16*       SEND_VAL_EX                                              'Test2'
         17*       DO_FCALL                                      0          
         18*       ASSIGN                                                   !1, $10
   12    19*       NEW                                              $13     'Exception'
         20*       SEND_VAL_EX                                              'test3'
         21*       DO_FCALL                                      0          
         22*       THROW                                         0          $13
         23*       FAST_RET                                                 
   15    24*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.57 ms | 1399 KiB | 16 Q