3v4l.org

run code in 300+ PHP versions simultaneously
<?php // this makes ob_end_clean raise an error ob_end_flush(); class ExceptionHandler { public function __invoke (Exception $e) { // this triggers the custom error handler ob_end_clean(); } } // this must be a class, closure does not trigger segfault set_exception_handler(new ExceptionHandler()); // exception must be throwed from error handler. set_error_handler(function() { $e = new Exception; $e->_trace = debug_backtrace(); throw $e; }); // trigger error handler $a['waa'];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VpaOO
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'ob_end_flush'
          1        DO_ICALL                                                 
   15     2        INIT_FCALL                                               'set_exception_handler'
          3        NEW                                              $2      'ExceptionHandler'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   18     7        INIT_FCALL                                               'set_error_handler'
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVpaOO%3A18%240'
   24     9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
   27    11        FETCH_DIM_R                                      ~7      !0, 'waa'
         12        FREE                                                     ~7
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVpaOO%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/VpaOO
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Exception'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_FCALL                                               'debug_backtrace'
          4        DO_ICALL                                         $5      
          5        ASSIGN_OBJ                                               !0, '_trace'
          6        OP_DATA                                                  $5
   23     7      > THROW                                         0          !0
   24     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVpaOO%3A18%240

Class ExceptionHandler:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VpaOO
function name:  __invoke
number of ops:  4
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'ob_end_clean'
          2        DO_ICALL                                                 
   11     3      > RETURN                                                   null

End of function __invoke

End of class ExceptionHandler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.61 ms | 1396 KiB | 23 Q