3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CErrorException extends Exception {} function handleError($level, $message, $file, $line){ var_dump(error_reporting()); if( error_reporting() != 0){ throw new CErrorException($message, $level); } } function handleException(Exception $exception){ var_dump('Exception handled at global level'); } set_error_handler('handleError'); set_exception_handler('handleException'); try { require_once('non\existent\file'); //Will generate an error and cause an exception to be thrown. } catch (Exception $e) { var_dump("let's deal with the exception"); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ljehL
function name:  (null)
number of ops:  13
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'handleError'
          2        DO_ICALL                                                 
   17     3        INIT_FCALL                                               'set_exception_handler'
          4        SEND_VAL                                                 'handleException'
          5        DO_ICALL                                                 
   20     6        INCLUDE_OR_EVAL                                          'non%5Cexistent%5Cfile', REQUIRE_ONCE
          7      > JMP                                                      ->12
   21     8  E > > CATCH                                       last         'Exception'
   22     9    >   INIT_FCALL                                               'var_dump'
         10        SEND_VAL                                                 'let%27s+deal+with+the+exception'
         11        DO_ICALL                                                 
   23    12    > > RETURN                                                   1

Function handleerror:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ljehL
function name:  handleError
number of ops:  19
compiled vars:  !0 = $level, !1 = $message, !2 = $file, !3 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    5     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'error_reporting'
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
    6     9        INIT_FCALL                                               'error_reporting'
         10        DO_ICALL                                         $6      
         11        IS_NOT_EQUAL                                             $6, 0
         12      > JMPZ                                                     ~7, ->18
    7    13    >   NEW                                              $8      'CErrorException'
         14        SEND_VAR_EX                                              !1
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0          
         17      > THROW                                         0          $8
    9    18    > > RETURN                                                   null

End of function handleerror

Function handleexception:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ljehL
function name:  handleException
number of ops:  5
compiled vars:  !0 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'Exception+handled+at+global+level'
          3        DO_ICALL                                                 
   13     4      > RETURN                                                   null

End of function handleexception

Class CErrorException: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.59 ms | 1400 KiB | 21 Q