Re: Re: PATCH: anonymous functions in PHP

From: Date: Sun, 16 Dec 2007 11:24:17 +0000
Subject: Re: Re: PATCH: anonymous functions in PHP
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-34045@lists.php.net to get a copy of this message
Actually it's the opposite. With create_function, you can bind variables, by marshalling them to a string and embed them in the function-definition. With a static syntax, this isn't possible. However, this is only a problem, when you need to bind variables, which isn't always the case and even then, there are other ways to bind variables in runtime. So it's different from create_function, in that it doesn't allow binding of variables, but I don't see why that should stop us from implementing, considering the benefits it gives in readability and debugging. -- troels On Dec 16, 2007 7:57 AM, Stanislav Malyshev <stas@zend.com> wrote: > I think the problem there is that this syntax wouldn't support external > variables, and without them there's not much difference between that and > create_function. > > > troels knak-nielsen wrote: > > What was the conclusion on Wez' patch from march [1]? The discussion > > seemed to steer a bit off, on the discussion of scoping rules, but is > > there any reason _not_ to implement Wez' patch in HEAD? > > Even if it doesn't entirely replace create_function, it would be nice > > to have as a compile-time alternative. > > > > [1] > > http://groups.google.com/group/mailing.www.php-dev/browse_thread/thread/a2c3296dc791369a/075209b288cb28de > > > > -- > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com >

« previous php.internals (#34045) next »