note 115240 added to language.exceptions
| From: | telefoontoestel at nospam dot org | Date: | Wed, 18 Jun 2014 12:34:06 +0000 |
| Subject: | note 115240 added to language.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199713@lists.php.net to get a copy of this message | ||
When using finally keep in mind that when a exit/die statement is used in the catch block it will
NOT go through the finally block.
<?php
try {
echo "try block<br />";
throw new Exception("test");
} catch (Exception $ex) {
echo "catch block<br />";
} finally {
echo "finally block<br />";
}
// try block
// catch block
// finally block
?>
<?php
try {
echo "try block<br />";
throw new Exception("test");
} catch (Exception $ex) {
echo "catch block<br />";
exit(1);
} finally {
echo "finally block<br />";
}
// try block
// catch block
?>
----
Server IP: 72.52.91.14
Probable Submitter: 80.113.17.58
----
Manual Page -- http://php.net/manual/en/language.exceptions.php
Edit -- https://master.php.net/note/edit/115240
Del: integrated -- https://master.php.net/note/delete/115240/integrated
Del: useless -- https://master.php.net/note/delete/115240/useless
Del: bad code -- https://master.php.net/note/delete/115240/bad+code
Del: spam -- https://master.php.net/note/delete/115240/spam
Del: non-english -- https://master.php.net/note/delete/115240/non-english
Del: in docs -- https://master.php.net/note/delete/115240/in+docs
Del: other reasons-- https://master.php.net/note/delete/115240
Reject -- https://master.php.net/note/reject/115240
Search -- https://master.php.net/manage/user-notes.php