note 112507 added to language.exceptions
| From: | Edu | Date: | Mon, 24 Jun 2013 18:13:36 +0000 |
| Subject: | note 112507 added to language.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195334@lists.php.net to get a copy of this message | ||
The "finally" block can change the exception that has been throw by the catch block.
<?php
try{
try {
throw new \Exception("Hello");
} catch(\Exception $e) {
echo $e->getMessage()." catch in\n";
throw $e;
} finally {
echo $e->getMessage()." finally \n";
throw new \Exception("Bye");
}
} catch (\Exception $e) {
echo $e->getMessage()." catch out\n";
}
?>
The output is:
Hello catch in
Hello finally
Bye catch out
----
Server IP: 69.147.83.199
Probable Submitter: 37.14.175.98
----
Manual Page -- http://php.net/manual/en/language.exceptions.php
Edit -- https://master.php.net/note/edit/112507
Del: integrated -- https://master.php.net/note/delete/112507/integrated
Del: useless -- https://master.php.net/note/delete/112507/useless
Del: bad code -- https://master.php.net/note/delete/112507/bad+code
Del: spam -- https://master.php.net/note/delete/112507/spam
Del: non-english -- https://master.php.net/note/delete/112507/non-english
Del: in docs -- https://master.php.net/note/delete/112507/in+docs
Del: other reasons-- https://master.php.net/note/delete/112507
Reject -- https://master.php.net/note/reject/112507
Search -- https://master.php.net/manage/user-notes.php