Re: Raising errors inside a constructor

From: Date: Mon, 16 Aug 2004 00:27:47 +0000
Subject: Re: Raising errors inside a constructor
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32697@lists.php.net to get a copy of this message
I don't see the point with being forced to make factory methods, only because there's no way to raise an error from the constructor.
why not? It makes the code alot clearer. If you need a single contructor, That may return errrors.. I aways try and use: $x = y::construct(...) It's clear this is returning something, and that something may be an error, where as I would never expect a constructor to do much more than instantate the object. Regards Alan
What do you think of these inherited methods : hasError() and popError() ? -- og


« previous php.pear.dev (#32697) next »