#35034 [NEW]: $this != ($this)
| From: | olympic at dino-online dot de | Date: | Mon, 31 Oct 2005 11:00:18 +0000 |
| Subject: | #35034 [NEW]: $this != ($this) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-87254@lists.php.net to get a copy of this message | ||
From: olympic at dino-online dot de
Operating system: *nix
PHP version: 5.0.5
PHP Bug Type: Feature/Change Request
Bug description: $this != ($this)
Description:
------------
$this is treated as references, while ($this) not...
$this != ($this) ?? omg :)
Reproduce code:
---------------
error_reporting(E_ALL);
class Bar {
function onlyByRefPlease(&$foo) {
// ...
}
function someMemberFunc1() {
$this->onlyByRefPlease($this);
}
function someMemberFunc2() {
$this->onlyByRefPlease(($this)); // note: 2 Braces!
}
};
$foo = new Bar();
$foo->someMemberFunc1();
$foo->someMemberFunc2(); // throws error
Expected result:
----------------
/* none */
Actual result:
--------------
Fatal error: Only variables can be passed by reference in
/www/v3.evalanche.com/web/php_refbug.php on line 13
--
Edit bug report at http://bugs.php.net/?id=35034&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35034&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35034&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35034&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35034&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35034&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35034&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35034&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35034&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35034&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35034&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35034&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35034&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35034&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35034&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35034&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35034&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35034&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35034&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35034&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35034&r=mysqlcfg