ID: 33537 Updated by: [EMAIL PROTECTED] Reported By: bo at theaddedones dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: OSX PHP Version: 5CVS-2005-07-01 (dev) New Comment:
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 . Previous Comments: ------------------------------------------------------------------------ [2005-07-01 17:47:45] bo at theaddedones dot com Description: ------------ i can understand this error from inside a class class Foo{ function bar(){ $this =& $something_else; } } but i should think one can assign a ref to $this to another var. class Foo{ function bar(){ $this_dupe =& $this; //fails to compile $this_dupe = $this; //compiles okay } } the reason i bring this up, is in php4 and 5.0 this is allowed .. if code needs to run on php4 without silly performance hits (i.e. data copy on assignment), would be nice to keep that. from the error it seems it is trying to do this $this =& $this_dupe .. but that is not what is being done Reproduce code: --------------- <?php class Foo{ function bar(){ $this_dupe =& $this; //fails to compile $this_dupe = $this; //works a okay } } Expected result: ---------------- hopefully it should compile fine Actual result: -------------- Fatal error: Cannot re-assign $this in {test.php} on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33537&edit=1