Re: Re: Classes, instances and NULL
| From: | Oliver Hitz | Date: | Thu, 29 Jul 2004 13:24:16 +0000 |
| Subject: | Re: Re: Classes, instances and NULL | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192186@lists.php.net to get a copy of this message | ||
On 29 Jul 2004, Mehdi Achour wrote:
> Hi Oliver, you should test with === instead of ==
> http://php.net/manual/en/language.operators.comparison.php
Thank you. I know there is a `===' operator, but to me this doesn't make
sense either.
class A { }
class B { var $x; }
It is logical that an instance of `A' is not identical to null. However,
why is an instance of
A' equal (==' operator) to null, an instance of
`B' not? Do objects automatically evaluate to their associative array
representation? Is this intended behaviour?
Thanks
Oliver