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) { echo "Exception_Foo caught: " . $e->getMessage(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HR3g5
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/HR3g5
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 = 8
Branch analysis from position: 8
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/HR3g5
function name:  bar
number of ops:  9
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                                                      ->8
   15     3  E > > CATCH                                       last         'Exception_Foo'
   16     4    >   INIT_METHOD_CALL                                         !0, 'getMessage'
          5        DO_FCALL                                      0  $2      
          6        CONCAT                                           ~3      'Exception_Foo+caught%3A+', $2
          7        ECHO                                                     ~3
   18     8    > > RETURN                                                   null

End of function bar

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1398 KiB | 14 Q