Re: bug or feature?
| From: | Zeev Suraski | Date: | Tue, 22 May 2001 12:58:35 +0000 |
| Subject: | Re: bug or feature? | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-56263@lists.php.net to get a copy of this message | ||
At 15:49 22/5/2001, Kristian Köhntopp wrote:
Zeev Suraski wrote: It's good that this question was asked, but really, be prepared to the fact that 'no' can also be an answer. Then let me rephrase the question: What is the recommended way to signal error conditions from the inside of an object constructor?Have a predefined error property that can be checked in case startup fails: function foo_class() {
$this->ok = false;
...initialize...
$this->ok = true;
}
$obj = new foo_class;
if (!$obj->ok) {
...} That should always work. Zeev