note 97963 added to language.exceptions
| From: | zmunoz at gmail dot com | Date: | Tue, 18 May 2010 20:05:58 +0000 |
| Subject: | note 97963 added to language.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169376@lists.php.net to get a copy of this message | ||
When catching an exception inside a namespace it is important that you escape to the global space:
<?php
namespace SomeNamespace;
class SomeClass {
function SomeFunction() {
try {
throw new Exception('Some Error Message');
} catch (\Exception $e) {
var_dump($e->getMessage());
}
}
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 209.82.97.10
----
Manual Page -- http://www.php.net/manual/en/language.exceptions.php
Edit -- https://master.php.net/note/edit/97963
Del: integrated -- https://master.php.net/note/delete/97963/integrated
Del: useless -- https://master.php.net/note/delete/97963/useless
Del: bad code -- https://master.php.net/note/delete/97963/bad+code
Del: spam -- https://master.php.net/note/delete/97963/spam
Del: non-english -- https://master.php.net/note/delete/97963/non-english
Del: in docs -- https://master.php.net/note/delete/97963/in+docs
Del: other reasons-- https://master.php.net/note/delete/97963
Reject -- https://master.php.net/note/reject/97963
Search -- https://master.php.net/manage/user-notes.php