Re: [PHP] Re: Classes, instances and NULL

2004-07-29 Thread Oliver Hitz
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

[PHP] Classes, instances and NULL

2004-07-29 Thread Oliver Hitz
Hi all, I have stumbled across something odd related to classes, instances and NULL in PHP 4. Apparently, an instance of a class that doesn't contain any variables is always equal to NULL. class MyClass { function anyFunction() { ... } } $c = new MyClass(); if ($c == null)