|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-18 11:42 UTC] hholzgra@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 15:00:02 2025 UTC |
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.