RE: [PHP-DEV] Stop Breaking Our Apps For the Sake of OO
| From: | Jared Williams | Date: | Thu, 11 May 2006 20:15:00 +0000 |
| Subject: | RE: [PHP-DEV] Stop Breaking Our Apps For the Sake of OO | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23274@lists.php.net to get a copy of this message | ||
>
> Jared Williams wrote:
> >
> > Interesting logic break too...
> >
> > $foo = new stdClass();
> > if ($foo == null || $foo != null) { echo 'Never gets echoed'; }
>
> From a pure computer science point of view, the above makes
> complete sense. Null means unknown value, so nothing is equal
> to it, not even another null (because you don't know if the
> other null's *unknown* value is equal to this null's
> *unknown* value). is_null() would make more sense here.
Yes, in certain languages tristate logic makes sense. But I don't think PHP is intended to be
one of them.
Jared