bug76536.phpt 660 B

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