> On Aug 31, 2015, at 18:04, Bob Weinand <bobw...@hotmail.com> wrote:
> 
> From the RFC:
>> all variables used in the body of the anonymous function will automatically 
>> be bound to the anonymous function closure from the defining scope
> 
> The implementation is not capturing all the variables from the outer scope, 
> but strictly only these accessed by the variables in the Closure itself. 
> Hence that shouldn't be much of an issue.

This magic scares me. I made a very deliberate decision In the very first 
implementation of PHP to avoid scope side-effects like this. Inside a function 
everything is local unless explicitly declared not to be. This has carried 
through for the past 20+ years in slightly different ways, but the basic rule 
has stayed consistent even for closures. Unless explicitly declared via a use 
clause, every variable inside a closure is local and no cross-scope variable 
name side-effects are possible. I am not convinced that this feature is worth 
breaking that longstanding basic tenet of the language.

-Rasmus

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to