Re: Re: having fun with $this

From: Date: Thu, 06 Mar 2008 23:03:27 +0000
Subject: Re: Re: having fun with $this
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-36024@lists.php.net to get a copy of this message
On Thursday 06 March 2008 23:51:47 Edward Z. Yang wrote: > 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 php -r 'class A { function __construct() { $this+=41; var_dump($this); }} new A;' int(42) "should" is the right word here ;) Regards, Stefan

« previous php.internals (#36024) next »