|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-13 11:47 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
Description: ------------ Code witch works in PHP4 and 5.0 results in an error in 5.1.0 rc1: PHP Fatal error: Cannot re-assign $this. It can be fixed by removing the &. May be its no bug, but the error message is not clear to me: $this isn't assigned; $temp is. Reproduce code: --------------- <html> <body> <? class test { function doit() { $temp = &$this; return $temp; } } $obj = new test; $result = $obj->doit(); ?> Ok<br> </body> </html> Expected result: ---------------- OK Actual result: -------------- [Tue Sep 13 12:36:28 2005] [error] [client 192.168.100.46] PHP Fatal error: Cannot re-assign $this in /home/httpd/sites/devrw/root/test.php on line 7