On Tue, 26 Nov 2002 14:52:12 +0100
Bertrand Mansion <bmansion@xxxxxxxxxxx> wrote:
> > or true if ok ?
>
> Well, I meant false because this allows for :
> If (!$error = blabla()) {
> // No error here
> } else {
> // error here
> }
>
> :)
:-)))
> I don't know if this is very logical but at least it's my logic (?)
> I can make it work the other way if you prefer but then you will have
> to call if (!PEAR::isError(blabla())) all the time which is longer to
> type than!$error and adds some overhead to an already big class.
> Unless I missed something once again. Just let me know...
Well, I mainly prefer true on success (it seems to be usual too),
except on shell command which returns 0 on success, and positive number
on errors (posix?).
It's to you to add !blah each time instead of the user to think false is
a success :))
hth
pa
--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|