Re: "Cannot use $this as lexical variable" message still in PHP 5.4
| From: | Daniel Convissor | Date: | Tue, 10 Jan 2012 18:20:56 +0000 |
| Subject: | Re: "Cannot use $this as lexical variable" message still in PHP 5.4 | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-57328@lists.php.net to get a copy of this message | ||
Hi Etienne:
> To me it seems similar to assigning $this, only here it is via special
> closure syntax. Since this code is no longer necessary, and might conflict
> with the rebinding of $this, the error makes sense IMHO.
A clearer error message seems appropriate. It should indicate that
use($this) is inappropriate, but that $this can be used. Something
_like_ "$this is available without being declared."
Thanks,
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409