bruce wrote:
in their constructor, they have the 'return false' arrggghh!!! a quick look
at google, and it appears that you can't return any val from a constructor.
in fact, the 'object id' that's being returned appears to simply be (as you
stated) the instance of the class that was created... as opposed to a return
val...

If you want to stop the object from being created for any reason (e.g. connection to database failed) and you're using PHP 5, I believe that you can throw an exception in the constructor.

From http://php.net/language.oop5.basic :

"An object will always be assigned when creating a new object unless the object has a constructor defined that throws an exception on error."

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to