ID: 36675
User updated by: iain at iaindooley dot com
Reported By: iain at iaindooley dot com
-Status: Bogus
+Status: Open
Bug Type: Class/Object related
Operating System: FreeBSD 6.0
PHP Version: 5.1.3RC3-dev
New Comment:
Yes, the line:
if($this->top_reference == $ref)
also causes the error, and changing the code in zend_operators.c as i
posted fixed the problem.
doing:
$var = FALSE;
if($some_other_var)
$var = new SomeObject();
if($var)
echo('we got here');
makes perfect sense, this is a bug.
Previous Comments:
------------------------------------------------------------------------
[2006-04-07 09:21:28] tony2001@php.net
>this same notice is also caused by:>if($obj1 == $obj2)
Did you try it? Please try and see.
>please do not dismiss a bug without properly understanding> what is going on.
Please don't claim anything if you didn't check it out yourself.
>if this is sensless then why doesn't it fail with the >simple test case i provided?
Because you're comparing objects to '', which is autoconverted to
FALSE.
Try to compare objects to non-empty strings and you'll the expected
warning.
It MAY change in the future, but this is not a bug, because comparing
circles to squares doesn't make any sense.
------------------------------------------------------------------------
[2006-04-07 08:48:57] iain at iaindooley dot com
haha i just notice that you (tony2001) were the one who stated:
Dmitry, I guess we need to return at least objects index in this
case.
Or maybe use the same way we use when compatibility_mode is on.
What do you think?
which is clearly what my patch does, which has somehow been undone in
later versions.
why would you dismiss such a thourough bug report as being senseless??
you could at least have the decency to forward it on to someone else.
------------------------------------------------------------------------
[2006-04-07 08:44:45] iain at iaindooley dot com
Wrong, this is not expected, as http://bugs.php.net/bug.php?id=33999
states, and this same notice is also caused by:
if($obj1 == $obj2)
please do not dismiss a bug without properly understanding what is
going on. if this is sensless then why doesn't it fail with the simple
test case i provided?
------------------------------------------------------------------------
[2006-04-07 08:37:04] tony2001@php.net
Comparing objects or resources to strings, booleans and integers is
obviously senseless.
This is expected behaviour.
------------------------------------------------------------------------
[2006-04-07 08:24:12] iain at iaindooley dot com
By the way, enabling compatbility mode causes problems because then you
cannot pass an object as the first argument of array_key_exists() which
is unintuitive
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/36675--
Edit this bug report at http://bugs.php.net/?id=36675&edit=1