By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,996 Members | 1,180 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,996 IT Pros & Developers. It's quick & easy.

List of Predefined PHP exceptions

P: n/a
I've tried searching w/ google and on php.net and still can't find a
complete list off all exceptions that are predefined. I need a null
object exception and don't want to write one if one already exists.
Does anyone know where a comprehensive list is?

Thanks

Oct 3 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 3 Okt., 22:07, Mister Joe <mrjoefri...@gmail.comwrote:
I've tried searching w/ google and on php.net and still can't find a
complete list off all exceptions that are predefined. I need a null
object exception and don't want to write one if one already exists.
Does anyone know where a comprehensive list is?

Thanks
PHP has only on Exception class with can be used via

throw new Exception("Hi i am there");

all other Exception Classes MUST be derived from there. I think there
is no list of
exception because PHP mostly generates errors or warning. The
Exception feature is new!
If you need a "null object exception" the you must create it on your
own

class NullObjectException extends Exception
{
public function __construct(){
parent::__construct("an object has been noll where its not
allowed);
}
}
function MyFunc(){
throw new NullObjectException();
}

try
{
MyFunc();
}
catch(Exception $e)
{
if($e instanceof NullObjectException){
echo "YEAHH i am a NullObjectException";
}
}

I dont know if there's such a list you want to get. I developed some
basic exceptions for my own
like in .net!

Hope this helps ;)
Oct 3 '07 #2

P: n/a
On Oct 3, 4:07 pm, Mister Joe <mrjoefri...@gmail.comwrote:
I've tried searching w/ google and on php.net and still can't find a
complete list off all exceptions that are predefined. I need a null
object exception and don't want to write one if one already exists.
Does anyone know where a comprehensive list is?

Thanks
<http://www.php.net/~helly/php/ext/spl/classException.html>

Oct 3 '07 #3

P: n/a
On 3 Okt., 22:48, ZeldorBlat <zeldorb...@gmail.comwrote:
On Oct 3, 4:07 pm, Mister Joe <mrjoefri...@gmail.comwrote:
I've tried searching w/ google and on php.net and still can't find a
complete list off all exceptions that are predefined. I need a null
object exception and don't want to write one if one already exists.
Does anyone know where a comprehensive list is?
Thanks

<http://www.php.net/~helly/php/ext/spl/classException.html>
thats nice ;)

But LogicException and RuntimeException are available since 5.1 while
the Core Exception class is there since 5.0! ;) No matter now they are
here ;)

Oct 3 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.