Re: [PHP-DEV] "Cannot use $this as lexical variable" message still in PHP 5.4

2012-01-10 Thread Daniel Convissor
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($thi

Re: [PHP-DEV] "Cannot use $this as lexical variable" message still in PHP 5.4

2012-01-07 Thread Etienne Kneuss
Hi, On Jan 7, 2012 10:41 AM, "Sebastian Bergmann" wrote: > > Am 07.01.2012 10:34, schrieb Stas Malyshev: > > Why you need to add $this there? $this should be available automatically > > IIRC unless you make the closure static. > > That is not the point I wanted to make. Explicitly listing $this

Re: [PHP-DEV] "Cannot use $this as lexical variable" message still in PHP 5.4

2012-01-07 Thread Sebastian Bergmann
Am 07.01.2012 10:34, schrieb Stas Malyshev: > Why you need to add $this there? $this should be available automatically > IIRC unless you make the closure static. That is not the point I wanted to make. Explicitly listing $this in use() should not trigger a compiler error, IMHO. I just wanted t

Re: [PHP-DEV] "Cannot use $this as lexical variable" message still in PHP 5.4

2012-01-07 Thread Stas Malyshev
Hi! is still in zend_compile.c. IIRC, this code was added in PHP 5.3 to prevent $this from being used as a lexical variable. It should no longer be required in PHP 5.4. Right? Why you need to add $this there? $this should be available automatically IIRC unless you make the closure st

[PHP-DEV] "Cannot use $this as lexical variable" message still in PHP 5.4

2012-01-07 Thread Sebastian Bergmann
While c(); }; } } compiles as expected with PHP 5.4, the following c(); }; } } results in Fatal error: Cannot use $this as lexical variable in ... This is because void zend_do_fetch_lexical_variable(znode *varname, zend_