diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-03-02 12:16:05 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-03-02 12:16:05 +0100 |
commit | 6ccb4788f6c44e8c67e27507e36ebe583a6a0d86 (patch) | |
tree | 61d7df874b66b368d05531e77d08129ed667ff31 /index.php | |
parent | e9e9e635b337dc46111cdf95ccb16b7d28deb849 (diff) |
Improve assertion handling
Enable it explicitly and make sure a failed assertion will always
terminate execution.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -297,6 +297,14 @@ function check_for_fatal() } register_shutdown_function("check_for_fatal"); +function _assert_failure($file, $line, $expr, $message = "") +{ + _actual_exception_handler(new Exception("assert($expr): Assertion failed in $file at line $line".($message != "" ? " with message: '$message'" : ""))); + exit(1); +} + +assert_options(ASSERT_ACTIVE, true); +assert_options(ASSERT_CALLBACK, '_assert_failure'); /* * -------------------------------------------------------------------- * LOAD THE BOOTSTRAP FILE |