Anonymous Functions in PHP
Anonymous functions to make their way into PHP? I'd like it. (via)
Anonymous functions to make their way into PHP? I'd like it. (via)
I'm Jonathan Snook and I write about web design and development. I speak at conferences and I yammer on about what I'm having for lunch on Twitter. You can keep up to date with everything I blog here via the RSS feed.
Want to learn more?
TIPS, TRICKS & BOOKMARKS on WEB DEVELOPMENT
Conversation
lol, what I like is the following quote by the guy who is implementing it:
"However, his real question was whether anonymous functions should be part of PHP at all."
Either way, I would like to see this as well.
Would be nice to use in something like:
$my_var = preg_replace_callback($regex, function(match){ return strtolower(match[0]); }, $string);Wow...that looks a lot like JavaScript.
Great news
i'd like also to have a way to add anonymous func to null object
now i can add properties to this object
but i cant add methods like this
it will be very use full to create objects on fly in this way.