Handling exception question
- From: "Paul Czubilinski" <pawel@xxxxxxx>
- Date: 31 May 2006 10:37:01 -0700
Hello,
I have code like this:
class MyException extends Exception {}
function x() {
try {
throw new MyException()
} catch (Exception $e) {
echo 'Exception catched';
exit;
}
try {
x();
} catch (MyException $e) {
echo 'MyException catched';
exit;
}
I cannot understand why this code catches Exception instead of
MyException? Can you please tell me what is wrong with it?
Best rgrds,
Paul
.
- Follow-Ups:
- Re: Handling exception question
- From: Dikkie Dik
- Re: Handling exception question
- From: Sjoerd
- Re: Handling exception question
- Prev by Date: pear all packages for offline use
- Next by Date: Re: preg_match and delimited strings
- Previous by thread: pear all packages for offline use
- Next by thread: Re: Handling exception question
- Index(es):