1--TEST-- 2Bug #76536 (PHP crashes with core dump when throwing exception in error handler) 3--FILE-- 4<?php 5class SomeConstants {const SOME_CONSTANT = SOME_NONSENSE;} 6 7function handleError() {throw new ErrorException();} 8 9set_error_handler('handleError'); 10set_exception_handler('handleError'); 11 12$r = new \ReflectionClass(SomeConstants::class); 13$r->getConstants(); 14?> 15--EXPECTF-- 16Fatal error: Uncaught ErrorException in %sbug76536.php:%d 17Stack trace: 18#0 [internal function]: handleError(Object(ErrorException)) 19#1 {main} 20 thrown in %sbug76536.php on line %d 21