Recent Topics

1 Nov 24, 2006 13:29    

In my classes I've made, if the constructor receives invalid data that makes the whole instance of the class useless i would use unset($this); or $this = NULL;, but I've just moved to PHP5 and this is no longer supported.... Which is a real pain in the ass. Any suggestions on how i should now go about this...?

2 Nov 24, 2006 18:08

Use a factory, which returns either NULL or the object, if it's valid (e.g. according to some property).

3 Nov 25, 2006 03:23

A factory?

Atm what i've done is used return NULLs for the functions and i have a status variable that i set to NULL.


Form is loading...