![]() |
Anonymous Functions in PHP 5.3.0, deprecates create_function
I've seen in PHP 5.3.0 which has been recently released, allows for anonymous functions assigned to variables, so instead of doing this:
Example #1 PHP Code:
PHP Code:
We can do: PHP Code:
PHP Code:
|
Quote:
You have to wait for xampp to release an update, the module still needs to be coded into the program, thats why.. |
Now that 5.3.0 has been released, what do you think the Host penetration time will be? As in, how long do you think it will take for shared hosts to update their PHP version?
I have 1and1 and I don't think they'll be fast about updating anything. |
Quote:
|
Quote:
|
Something quite cool is also the
use keyword. I don't know if it's specifically for the anonymous functions, but it's great 'cause then you can pass in variables into functions that you need, but don't want to pass as a param when calling the function.PHP Code:
|
I think
use will also be used to specify which namespaces you're wanting to use. I like that feature in anonymous functions! |
Actually we didn't deprecate create_function() (I however suggested it that we did on IRC), the create_function is horrible, what it internally does is to eval() the code and create a runtime function (named __lambda_func) with a hash returned, so its horrible slow and can easily be injected as theres no protection at the eval.
Closures with 5.3 is however really nicely implemented, they are actually implemented in an object oriented way, meaning that: PHP Code:
PHP Code:
PHP Code:
As for the Windows stuff, just configure your own Apache and load the PHP dll, takes two minutes and whoop whoop you have it running (but thats just me who does it manually =P) |
Quote:
Ryanmr, you should be able to request your host to update, or at least ask how long it will take for them to update, big hosting companies will make an update soon if, they already haven't done it, like godaddy.com i think is already done with updates.. |
i am having the same problem.
|
| All times are GMT. The time now is 12:37 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0