Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- declare(strict_types = 1);
- // for "auto_prepend_file" php.ini
- (function () {
- $hhb_exception_error_handler = function ($errno, $errstr, $errfile, $errline) {
- if (! (error_reporting () & $errno)) {
- // This error code is not included in error_reporting
- return;
- }
- throw new ErrorException ( $errstr, 0, $errno, $errfile, $errline );
- };
- $hhb_assert_handler = function ($file, $line, $code, $desc = null) {
- $errstr = 'Assertion failed at ' . $file . ':' . $line . ' ' . $desc . ' code: ' . $code;
- throw new ErrorException ( $errstr, 0, 1, $file, $line );
- };
- error_reporting ( E_ALL );
- set_error_handler ( $hhb_exception_error_handler );
- // ini_set("log_errors",'On');
- // ini_set("display_errors",'On');
- // ini_set("log_errors_max_len",'0');
- // ini_set("error_prepend_string",'<error>');
- // ini_set("error_append_string",'</error>'.PHP_EOL);
- // ini_set("error_log",__DIR__.DIRECTORY_SEPARATOR.'error_log.php.txt');
- assert_options ( ASSERT_ACTIVE, 1 );
- assert_options ( ASSERT_WARNING, 0 );
- assert_options ( ASSERT_QUIET_EVAL, 1 );
- assert_options ( ASSERT_CALLBACK, $hhb_assert_handler );
- }) ();
Add Comment
Please, Sign In to add comment