3v4l.org

run code in 300+ PHP versions simultaneously
<?php function user_exception_handler_01(Throwable $ex) { echo "01 Handled uncaught exception"; } function user_exception_handler_02(Throwable $ex) { restore_exception_handler(); throw new RuntimeException("Not able to handle, throwing another exception from handler"); echo "Should never see this"; } function throw_it() { throw new RuntimeException('Expected unexpected happened'); } function call_throw_it() { throw_it(); } set_exception_handler('user_exception_handler_01'); set_exception_handler('user_exception_handler_02'); call_throw_it();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARJ9A
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        SEND_VAL                                                 'user_exception_handler_01'
          2        DO_ICALL                                                 
   22     3        INIT_FCALL                                               'set_exception_handler'
          4        SEND_VAL                                                 'user_exception_handler_02'
          5        DO_ICALL                                                 
   24     6        INIT_FCALL                                               'call_throw_it'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function user_exception_handler_01:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARJ9A
function name:  user_exception_handler_01
number of ops:  3
compiled vars:  !0 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ECHO                                                     '01+Handled+uncaught+exception'
    5     2      > RETURN                                                   null

End of function user_exception_handler_01

Function user_exception_handler_02:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/ARJ9A
function name:  user_exception_handler_02
number of ops:  9
compiled vars:  !0 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'restore_exception_handler'
          2        DO_ICALL                                                 
    9     3        NEW                                              $2      'RuntimeException'
          4        SEND_VAL_EX                                              'Not+able+to+handle%2C+throwing+another+exception+from+handler'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
   10     7*       ECHO                                                     'Should+never+see+this'
   11     8*     > RETURN                                                   null

End of function user_exception_handler_02

Function throw_it:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/ARJ9A
function name:  throw_it
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $0      'RuntimeException'
          1        SEND_VAL_EX                                              'Expected+unexpected+happened'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
   15     4*     > RETURN                                                   null

End of function throw_it

Function call_throw_it:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARJ9A
function name:  call_throw_it
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'throw_it'
          1        DO_FCALL                                      0          
   19     2      > RETURN                                                   null

End of function call_throw_it

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
197.92 ms | 1018 KiB | 17 Q