#33319 [Bgs->Opn]: Cannot re-assign $this
| From: | sailormax at gmail dot com | Date: | Sun, 12 Jun 2005 22:36:08 +0000 |
| Subject: | #33319 [Bgs->Opn]: Cannot re-assign $this | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-80204@lists.php.net to get a copy of this message | ||
ID: 33319
User updated by: sailormax at gmail dot com
Reported By: sailormax at gmail dot com
-Status: Bogus
+Status: Open
Bug Type: Scripting Engine problem
Operating System: WinXP
PHP Version: 5.1.0b1
New Comment:
But I don't re-assign "$this"! I re-assign "$obj"! Why I can't do
this?
Previous Comments:
------------------------------------------------------------------------
[2005-06-12 23:22:14] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
so don\'t assign it by reference...
------------------------------------------------------------------------
[2005-06-12 23:12:58] sailormax at gmail dot com
Description:
------------
class member function do not accept bind to any variable address of
$this. I do not want edit "$this"! I want work with it by another
variable!
(zend.ze1_compatibility_mode = On)
Reproduce code:
---------------
<?
class foo
{
function test($obj = '')
{
if ($obj == '') $obj =& $this;
}
}
?>
Expected result:
----------------
everything must be ok
Actual result:
--------------
Fatal error: Cannot re-assign $this in index.php on line 6
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33319&edit=1