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();

preferences:
38.88 ms | 402 KiB | 5 Q