Page 1 of 1

object oriented php4

Posted: Tue Dec 27, 2005 5:14 am
by rajan
what will the best solution when there is some exception is generated in function of class?

Re: object oriented php4

Posted: Tue Dec 27, 2005 6:33 am
by foobar
rajan wrote:what will the best solution when there is some exception is generated in function of class?
There is no exception handling in PHP4.

You have to know what the error will look like and intercept it with a control statement. Whatever you do after that is completely up to you. You could die() with a message, log a message with a logging function, instantiate an error class, you name it!

I don't really think there is a canonical "best" solution to it.

Re: object oriented php4

Posted: Tue Dec 27, 2005 7:39 am
by BDKR
foobar wrote:I don't really think there is a canonical "best" solution to it.
Well put.