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); } } class NewException extends Exception {} try { throw new NewException("Catch me once", 1); } catch (Exception $e) { ExceptionHandler::handleException($e); } set_exception_handler(array("ExceptionHandler", "handleException")); 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: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/NYnu5
function name:  (null)
number of ops:  19
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'NewException'
          1        SEND_VAL_EX                                              'Catch+me+once'
          2        SEND_VAL_EX                                              1
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
          5*       JMP                                                      ->10
   16     6  E > > CATCH                                       last         'Exception'
   17     7    >   INIT_STATIC_METHOD_CALL                                  'ExceptionHandler', 'handleException'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0          
   19    10        INIT_FCALL                                               'set_exception_handler'
         11        SEND_VAL                                                 <array>
         12        DO_ICALL                                                 
   21    13        NEW                                              $5      'Exception'
         14        SEND_VAL_EX                                              'Catch+me+twice'
         15        SEND_VAL_EX                                              2
         16        DO_FCALL                                      0          
         17      > THROW                                         0          $5
   22    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/NYnu5
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/NYnu5
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:
158.53 ms | 1405 KiB | 17 Q