Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi All,
Fairly new to PHP and I have a question on catching exceptions.
In the following code:Code: Select all
function getAddressList() {
try {
$string = 'a string';
[b]explode($string); [/b]
return $addrDao->getAddressList();
}
catch(Exception $e) {
return $e;
}
}'Wrong parameter count for explode()'.
However, if I change the call to explod($string) (which does not exist at all) the error is never
caught in the catch block. Also, if I reference a null object within the try block it is not caught in the catch block.
Does the try/catch of PHP catch only a certain type of exceptions.
Thanks for any info.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]