3v4l.org

run code in 300+ PHP versions simultaneously
<?php function errorHandler($errno, $errstr, $errfile, $errline) { throw new Exception($errstr); } function exceptionHandler($e) { echo "exceptionHandler: '", $e->getMessage(), "'\n"; } set_error_handler("errorHandler"); set_exception_handler("exceptionHandler"); // this works as expected //$a = $foo; // this does not $a = $foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K9NAR
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'errorHandler'
          2        DO_ICALL                                                 
   12     3        INIT_FCALL                                               'set_exception_handler'
          4        SEND_VAL                                                 'exceptionHandler'
          5        DO_ICALL                                                 
   18     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0  $4      
          8        ASSIGN                                                   !0, $4
          9      > RETURN                                                   1

Function errorhandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/K9NAR
function name:  errorHandler
number of ops:  9
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    4     4        NEW                                              $4      'Exception'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $4
    5     8*     > RETURN                                                   null

End of function errorhandler

Function exceptionhandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K9NAR
function name:  exceptionHandler
number of ops:  7
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ECHO                                                     'exceptionHandler%3A+%27'
          2        INIT_METHOD_CALL                                         !0, 'getMessage'
          3        DO_FCALL                                      0  $1      
          4        ECHO                                                     $1
          5        ECHO                                                     '%27%0A'
    9     6      > RETURN                                                   null

End of function exceptionhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.77 ms | 941 KiB | 18 Q