#34358 [Opn->Bgs]: Fatal error: Cannot re-assign $this(again)
| From: | derick@php.net | Date: | Thu, 15 Sep 2005 13:28:03 +0000 |
| Subject: | #34358 [Opn->Bgs]: Fatal error: Cannot re-assign $this(again) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85096@lists.php.net to get a copy of this message | ||
ID: 34358
Updated by: derick@php.net
Reported By: pacha dot shevaev at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5.*
New Comment:
It's still bogus, you can call it a BC break if you want, but we're not
going to change this back.
Previous Comments:
------------------------------------------------------------------------
[2005-09-15 15:23:37] pacha dot shevaev at gmail dot com
I'm not an expert in PHP internals but there's a guy(stereofrog) on the
SitePoint forum who has a different point of
view(http://www.sitepoint.com/forums/showpost.php?p=2146304&postcount=9):
[quote]
it's 'simply ridiculous. They have a code in zend_compile.c that
handles "$this=$x" and copy-pasted that code in the function that
comples assignment by reference. This should prevent "$this=&$x" (which
is wrong), but for some reason it "prevents" "$x=&$this" as well (which
is absolutely correct). It's pure c-level bug and has nothing to do
with "new object model" and other blah-blah.
[/quote]
------------------------------------------------------------------------
[2005-09-15 14:27:03] sniper@php.net
NOTE: This is about PHP 5. It might have worked in PHP 4 but it does
not and will not work in PHP 5.
------------------------------------------------------------------------
[2005-09-15 13:37:28] pacha dot shevaev at gmail dot com
I still find it a bug. I need a reference to $this for BC with PHP4 in
the following piece of code:
function &getRootDataSource() {
$root =& $this;
while ($root->parent != NULL) {
$root =& $root->parent;
}
return $root;
}
------------------------------------------------------------------------
[2005-09-03 13:44:07] 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
------------------------------------------------------------------------
[2005-09-03 13:41:15] helly@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
Objects are already references in PHP 5, thuse there is no sense in
...&$this in any way.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34358
--
Edit this bug report at http://bugs.php.net/?id=34358&edit=1