From:             [EMAIL PROTECTED]
Operating system: any
PHP version:      4.1.1
PHP Bug Type:     Class/Object related
Bug description:  object without any data members equals to false

The code
<?
class A { function foo() {} }
$a = new A;
var_dump($a);
if ($a == false) echo "hahaha";
?>

outputs
"object(a)(0) { } hahaha"

So, for some strange reason PHP thinks that object without data members is
"false". Of course, if we replace "==" with "===", it all works fine, but
that is still a bug.

This problem exists in all existing PHP versions on all platforms.
-- 
Edit bug report at: http://bugs.php.net/?id=15103&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to