Re: Closures in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, January 10, 2008 4:22 am, John Papas wrote:
> Is there any functionality in PHP similar to closures?

Sort of.

There is a create_function:
http://php.net/create_function

> Are there any plans to add it..?

There was discussion on the php-internals list last week about
replacing create_function or, rather, adding a new way to create a
closure-like thingie.

It would not have the full-blown closure behaviour you may be used to
from other languages.

And, actually, the implementation that seemed to get the most
approbation was a simple way to create a function as a kind of a
resource (like a MySQL connection resource) and then you could pass it
around and use it.

It still didn't have a full-blown closure behaviour, as I recall, of
keeping the entire environment at the time of the function defintion.

If you want something that esoteric, go use Lisp. :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux