Re: having fun with $this

From: Date: Thu, 06 Mar 2008 22:51:47 +0000
Subject: Re: having fun with $this
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-36023@lists.php.net to get a copy of this message
Cristian Rodriguez wrote: > In all those cases, I expect a fatal error : cannot re-asign $this. > right ? or Im missing something ? These examples don't cause any problems because they're not in the object context, so $this is just another, ordinary variable. If you include'd the files inside something like: class Foo { public function bar() { include 'this-test.php'; } } there should be an error -- Edward Z. Yang GnuPG: 0x869C48DA HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

« previous php.internals (#36023) next »