Guest User

Untitled

a guest
Nov 24th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <?php
  2. declare(strict_types = 1);
  3. // for "auto_prepend_file" php.ini
  4. (function () {
  5. $hhb_exception_error_handler = function ($errno, $errstr, $errfile, $errline) {
  6. if (! (error_reporting () & $errno)) {
  7. // This error code is not included in error_reporting
  8. return;
  9. }
  10. throw new ErrorException ( $errstr, 0, $errno, $errfile, $errline );
  11. };
  12. $hhb_assert_handler = function ($file, $line, $code, $desc = null) {
  13. $errstr = 'Assertion failed at ' . $file . ':' . $line . ' ' . $desc . ' code: ' . $code;
  14. throw new ErrorException ( $errstr, 0, 1, $file, $line );
  15. };
  16. error_reporting ( E_ALL );
  17. set_error_handler ( $hhb_exception_error_handler );
  18. // ini_set("log_errors",'On');
  19. // ini_set("display_errors",'On');
  20. // ini_set("log_errors_max_len",'0');
  21. // ini_set("error_prepend_string",'<error>');
  22. // ini_set("error_append_string",'</error>'.PHP_EOL);
  23. // ini_set("error_log",__DIR__.DIRECTORY_SEPARATOR.'error_log.php.txt');
  24. assert_options ( ASSERT_ACTIVE, 1 );
  25. assert_options ( ASSERT_WARNING, 0 );
  26. assert_options ( ASSERT_QUIET_EVAL, 1 );
  27. assert_options ( ASSERT_CALLBACK, $hhb_assert_handler );
  28. }) ();
Add Comment
Please, Sign In to add comment