forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@- Added set_exception_handler() function for registering a global,
@ catch-all exception handling function (Stig) - Added set_exception_handler() function for registering a global, catch-all exception handling function (Stig)
- Loading branch information
Showing
5 changed files
with
152 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
--TEST-- | ||
ZE2: set_exception_handler() | ||
--SKIPIF-- | ||
<?php if (version_compare(zend_version(), "2", "<")) print "skip"; ?> | ||
--FILE-- | ||
<?php | ||
|
||
---- EXPECTED OUTPUT | ||
test_i | ||
test | ||
---- ACTUAL OUTPUT | ||
test_itest | ||
---- FAILED | ||
set_exception_handler("my_handler"); | ||
try { | ||
throw new exception(); | ||
} catch (stdClass $e) { | ||
print "BAR\n"; | ||
} | ||
|
||
function my_handler($exception) { | ||
print "FOO\n"; | ||
} | ||
|
||
?> | ||
--EXPECT-- | ||
FOO |