473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

List of Predefined PHP exceptions

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
3 6339
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: cody | last post by:
I have a method that gets called if the user presses a certain button. If the object is in a state that doesn't allow the calling of that method, what should I do? Should I better throw an...
22
by: Drew | last post by:
How do I know which exceptions are thrown by certain methods? For example, reading a file might throw an IO Exception, etc. In Java, the compiler won't even let you compile unless you put your...
11
by: C# Learner | last post by:
What type of exception should I throw when my code detects that a connection has dropped (i.e. NetworkStream.Read() returns 0)? Should I just throw a SocketException or should I create my own...
3
by: Julia | last post by:
Thanks for all you responses assuming I have a collection of objects which I want to save in a database I wonder if the following is the way to deal with a situation that only some of the...
2
by: felecha | last post by:
I learned about Exceptions in School, and now that I'm building my first real application on the job, I'm going through it trying to analyze it for all possible Exceptions so I can handle them...
2
by: Zytan | last post by:
I know that WebRequest.GetResponse can throw WebException from internet tutorials. However in the MSDN docs: http://msdn2.microsoft.com/en-us/library/system.net.webrequest.getresponse.aspx It...
1
by: suman.nandan | last post by:
Hi C++ Experts, Where can I find a list of exceptions thrown form std::string class and at what scenario ? Thanks in advance ! Suman.
0
debasisdas
by: debasisdas | last post by:
In PL/SQL, a warning or error condition is called an exception. Exceptions can be internally defined (by the runtime system) or user defined. A runtime error such as stack overflow or division...
17
by: Christoph Zwerschke | last post by:
I'm just reading PEP 3107 (function annotations) and wonder why exceptions are not mentioned there. I think it would be helpful if one could specify which exceptions can be raised by a function,...
2
by: =?windows-1252?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
Is there any way to tell PHP predefined variables ($GLOBALS, $argv, $argc, $_GET, $_POST…) from *global* user-defined variables? Neither $GLOBALS nor get_defined_vars() put user data apart. I’m...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.