ID: 40721
Updated by: [EMAIL PROTECTED]
Reported By: rod at pu-gh dot com
-Status: Open
+Status: Wont fix
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.4.6
New Comment:
You'll have to upgrade to PHP5.
Previous Comments:
------------------------------------------------------------------------
[2007-03-05 03:00:52] rod at pu-gh dot com
Description:
------------
When overloading a class in php, and then comparing an overloaded
property to the return value of a function call, the result is not what
I expected. If comparing against string literals, or if the result of
each is first assigned to a variable then it's fine.
I tested this with latest CVS of PHP 4.4.7.
Reproduce code:
---------------
<?
class Foo {
function __get( $name, &$value ) {
$value = 'foo';
return true;
}
}
overload( 'Foo' );
class Bar {
function foo() {
return 'bar';
}
}
$foo = new Foo();
$bar = new Bar();
echo 'Test: ' . ( $foo->bar == $bar->foo() ? 'BAD' : 'GOOD' ) . "\n";
?>
Expected result:
----------------
Expected (meaning the comparsion failed):
Test: GOOD
Actual result:
--------------
Actual (meaning the comparsion 'foo' == 'bar' succeeded):
Test: BAD
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40721&edit=1