3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExceptionHandler { public static function printException(Exception $e) { print 'Uncaught '.get_class($e).', code: ' . $e->getCode() . "<br />Message: " . htmlentities($e->getMessage())."\n"; } public static function handleException(Exception $e) { self::printException($e); } } set_exception_handler(array("ExceptionHandler", "handleException")); class NewException extends Exception {} try { throw new NewException("Catch me once", 1); } catch (Exception $e) { ExceptionHandler::handleException($e); } throw new Exception("Catch me twice", 2); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/mWMQi
function name:  (null)
number of ops:  19
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        SEND_VAL                                                 <array>
          2        DO_ICALL                                                 
   18     3        NEW                                              $2      'NewException'
          4        SEND_VAL_EX                                              'Catch+me+once'
          5        SEND_VAL_EX                                              1
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $2
          8*       JMP                                                      ->13
   19     9  E > > CATCH                                       last         'Exception'
   20    10    >   INIT_STATIC_METHOD_CALL                                  'ExceptionHandler', 'handleException'
         11        SEND_VAR                                                 !0
         12        DO_FCALL                                      0          
   23    13        NEW                                              $5      'Exception'
         14        SEND_VAL_EX                                              'Catch+me+twice'
         15        SEND_VAL_EX                                              2
         16        DO_FCALL                                      0          
         17      > THROW                                         0          $5
   24    18*     > RETURN                                                   1

Class ExceptionHandler:
Function printexception:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mWMQi
function name:  printException
number of ops:  17
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        GET_CLASS                                        ~1      !0
          2        CONCAT                                           ~2      'Uncaught+', ~1
          3        CONCAT                                           ~3      ~2, '%2C+code%3A+'
          4        INIT_METHOD_CALL                                         !0, 'getCode'
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      ~3, $4
          7        CONCAT                                           ~6      ~5, '%3Cbr+%2F%3EMessage%3A+'
          8        INIT_FCALL                                               'htmlentities'
          9        INIT_METHOD_CALL                                         !0, 'getMessage'
         10        DO_FCALL                                      0  $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                         $8      
         13        CONCAT                                           ~9      ~6, $8
         14        CONCAT                                           ~10     ~9, '%0A'
         15        ECHO                                                     ~10
    6    16      > RETURN                                                   null

End of function printexception

Function handleexception:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mWMQi
function name:  handleException
number of ops:  5
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        INIT_STATIC_METHOD_CALL                                  'printException'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   11     4      > RETURN                                                   null

End of function handleexception

End of class ExceptionHandler.

Class NewException: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.47 ms | 945 KiB | 18 Q