3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(ini_get('zend.enable_gc')); class A { public static $B = array(); } class Controller { public function throwException() { throw new Exception("Test"); } } 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'); A::$B['Handler'] = new ExceptionHandler; A::$B['Controller'] = new Controller; A::$B['Controller']->throwException();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aRuC4
function name:  (null)
number of ops:  24
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                                                 
   37     6        INIT_FCALL                                               'set_error_handler'
          7        SEND_VAL                                                 'error'
          8        DO_ICALL                                                 
   40     9        NEW                                              $5      'ExceptionHandler'
         10        DO_FCALL                                      0          
         11        FETCH_STATIC_PROP_W          unknown             $3      'B'
         12        ASSIGN_DIM                                               $3, 'Handler'
         13        OP_DATA                                                  $5
   41    14        NEW                                              $9      'Controller'
         15        DO_FCALL                                      0          
         16        FETCH_STATIC_PROP_W          unknown             $7      'B'
         17        ASSIGN_DIM                                               $7, 'Controller'
         18        OP_DATA                                                  $9
   43    19        FETCH_STATIC_PROP_R          unknown             ~11     'B'
         20        FETCH_DIM_R                                      ~12     ~11, 'Controller'
         21        INIT_METHOD_CALL                                         ~12, 'throwException'
         22        DO_FCALL                                      0          
         23      > RETURN                                                   1

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

End of function error

Class A: [no user functions]
Class Controller:
Function throwexception:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/aRuC4
function name:  throwException
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'Test'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
   15     4*     > RETURN                                                   null

End of function throwexception

End of class Controller.

Class ExceptionHandler:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aRuC4
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   24     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/aRuC4
function name:  __invoke
number of ops:  5
compiled vars:  !0 = $e, !1 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   28     1        INIT_METHOD_CALL                                         !1, 'getMessage'
          2        DO_FCALL                                      0  $2      
          3        ECHO                                                     $2
   29     4      > RETURN                                                   null

End of function __invoke

End of class ExceptionHandler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.22 ms | 1405 KiB | 21 Q