Date: 05/22/01
- Next message: Andrei Zmievski: "Re: [PHP-DEV] RE: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c basic_functions.h"
- Previous message: fbaker <email protected>: "[PHP-DEV] Bug #11026: Example in man has error."
- In reply to: Kristian Köhntopp: "Re: [PHP-DEV] bug or feature?"
- Next in thread: Zeev Suraski: "Re: [PHP-DEV] bug or feature?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Andrei Zmievski: "Re: [PHP-DEV] RE: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c basic_functions.h"
- Previous message: fbaker <email protected>: "[PHP-DEV] Bug #11026: Example in man has error."
- In reply to: Kristian Köhntopp: "Re: [PHP-DEV] bug or feature?"
- Next in thread: Zeev Suraski: "Re: [PHP-DEV] bug or feature?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

