3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(ini_get('zend.enable_gc')); class ExceptionHandler { public function __construct() { set_exception_handler($this); } public function __invoke(Exception $e) { echo $exception->getMessage(); } } function error($no, $message) { throw new Exception($message); } set_error_handler('error'); new ExceptionHandler; throw new Exception("Test");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/vThSI
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'ini_get'
          2        SEND_VAL                                                 'zend.enable_gc'
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   22     6        INIT_FCALL                                               'set_error_handler'
          7        SEND_VAL                                                 'error'
          8        DO_ICALL                                                 
   23     9        NEW                                              $3      'ExceptionHandler'
         10        DO_FCALL                                      0          
         11        FREE                                                     $3
   25    12        NEW                                              $5      'Exception'
         13        SEND_VAL_EX                                              'Test'
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $5
         16*     > RETURN                                                   1

Function error:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/vThSI
function name:  error
number of ops:  7
compiled vars:  !0 = $no, !1 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        NEW                                              $2      'Exception'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $2
   20     6*     > RETURN                                                   null

End of function error

Class ExceptionHandler:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vThSI
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    9     4      > RETURN                                                   null

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vThSI
function name:  __invoke
number of ops:  5
compiled vars:  !0 = $e, !1 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        INIT_METHOD_CALL                                         !1, 'getMessage'
          2        DO_FCALL                                      0  $2      
          3        ECHO                                                     $2
   14     4      > RETURN                                                   null

End of function __invoke

End of class ExceptionHandler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.51 ms | 1400 KiB | 21 Q