From: rod at pu-gh dot com Operating system: Linux PHP version: 4.4.6 PHP Bug Type: Scripting Engine problem Bug description: Overload Comparison Problem
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 bug report at http://bugs.php.net/?id=40721&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40721&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40721&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40721&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40721&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40721&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40721&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40721&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40721&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40721&r=support Expected behavior: http://bugs.php.net/fix.php?id=40721&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40721&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40721&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40721&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40721&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40721&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40721&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40721&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40721&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40721&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40721&r=mysqlcfg