having fun with $this
| From: | Cristian Rodriguez | Date: | Thu, 06 Mar 2008 21:38:31 +0000 |
| Subject: | having fun with $this | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-36022@lists.php.net to get a copy of this message | ||
Hi:
It is still possible to re-asign $this in a number of ways
examples
<?php
$this .= '123';
var_dump($this);
//Notice: Undefined variable: this in this.php on line 3
//string(3) "123"
<?php
$this{1} = '123';
var_dump($this);
/* array(1) {
[1]=>
string(3) "123"
}
*/
or ..
$this['foo'] = '123';
var_dump($this);
In all those cases, I expect a fatal error : cannot re-asign $this.
right ? or Im missing something ?
Thanks..
--
"If debugging is the process of removing bugs, then programming must
be the process of putting them in." – Edsger Dijkstra
http://www.cristianrodriguez.net