3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Exception_Foo extends Exception {} class Exception_Bar extends Exception {} function foo() { throw new Exception_Foo('thing happened'); } function bar() { try { foo(); } catch (Exception_Foo $e) { throw new Exception_Bar("Exception_Foo caught: " . $e->getMessage()); } } function baz() { try { bar(); } catch (Exception_Bar $e) { print_r($e); } } baz();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FYn9p
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_FCALL                                               'baz'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/FYn9p
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $0      'Exception_Foo'
          1        SEND_VAL_EX                                              'thing+happened'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
    9     4*     > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
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 = 108) Position 1 = -2
filename:       /in/FYn9p
function name:  bar
number of ops:  12
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->11
   15     3  E > > CATCH                                       last         'Exception_Foo'
   16     4    >   NEW                                              $2      'Exception_Bar'
          5        INIT_METHOD_CALL                                         !0, 'getMessage'
          6        DO_FCALL                                      0  $3      
          7        CONCAT                                           ~4      'Exception_Foo+caught%3A+', $3
          8        SEND_VAL_EX                                              ~4
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $2
   18    11    > > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
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/FYn9p
function name:  baz
number of ops:  8
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'bar'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->7
   24     3  E > > CATCH                                       last         'Exception_Bar'
   25     4    >   INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   27     7    > > RETURN                                                   null

End of function baz

Class Exception_Foo: [no user functions]
Class Exception_Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.14 ms | 1403 KiB | 18 Q