Re: [PHP] Q on class failure...

2003-09-22 Thread Robert Cummings
On Mon, 2003-09-22 at 13:25, jsWalter wrote: > > "Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > hi, > > > > It's generaly considered that constructors are supposed return an > > instance of that class. Use a factory instead if you want to return nulls; > >

Re: [PHP] Q on class failure...

2003-09-22 Thread jsWalter
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The constructor should be as quick as possible and have as little > logic as possible. What kind of failure are you trying to catch? not really trying to 'catch' a failure. I have to parse the given string format and d

Re: [PHP] Q on class failure...

2003-09-22 Thread jsWalter
"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi, > > It's generaly considered that constructors are supposed return an > instance of that class. Use a factory instead if you want to return nulls; A Factory? OK, I'll look that up, do some readng and try tha

Re: [PHP] Q on class failure...

2003-09-22 Thread Curt Zirzow
* Thus wrote jsWalter ([EMAIL PROTECTED]): > I found this in the docs... > >If you want your constructor to possibly not create the object > >class A >{ > function A() > { > // ... > // some error occurred > $this = null; > return; >

Re: [PHP] Q on class failure...

2003-09-21 Thread Raditha Dissanayake
hi, It's generaly considered that constructors are supposed return an instance of that class. Use a factory instead if you want to return nulls; jsWalter wrote: I found this in the docs... If you want your constructor to possibly not create the object class A { function A() {