#43163 [Opn->Csd]: $this with variable variable
| From: | felipe@php.net | Date: | Fri, 16 Nov 2007 15:58:48 +0000 |
| Subject: | #43163 [Opn->Csd]: $this with variable variable | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-211@lists.php.net to get a copy of this message | ||
ID: 43163
Updated by: felipe@php.net
Reported By: felipensp at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Linux
PHP Version: 5.3CVS-2007-10-31 (snap)
Assigned To: colder
Previous Comments:
------------------------------------------------------------------------
[2007-11-13 13:13:52] colder@php.net
Partially done, I'll add a note about $this not being modifiable as
well.
------------------------------------------------------------------------
[2007-10-31 16:32:38] johannes@php.net
As of PHP 5 $this is a very special variable, I couldn't find anything
in the docs about it's limitations, so I mark it as a doc bug.
Related to the original report: I'm also not seeing a hint that you
can't assign any value to $this in the docs (not even outside a class)
------------------------------------------------------------------------
[2007-10-31 16:10:53] felipensp at gmail dot com
Description:
------------
Variable $this doens't recognize as variable variable.
Reproduce code:
---------------
$a = 'this';
$$a->b;
Expected result:
----------------
Fatal error: Using $this when not in object context
Actual result:
--------------
Notice: Undefined variable: this ...
Notice: Trying to get property of non-object ...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43163&edit=1