Re: 5.4 beta
| From: | Frédéric Hardy | Date: | Sat, 08 Oct 2011 10:02:57 +0000 |
| Subject: | Re: 5.4 beta | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-55749@lists.php.net to get a copy of this message | ||
Hello !
> I don't think so, but if I had to summarize the innovations in 5.4, this would be it:
>
> - Closures can now have an associated scope
> - Closures can now have a bound object
> - Closures can now be either static or non-static
>
> - Closures defined in a place with an active scope are scoped accordingly
> - Closures defined inside an instance method (or bound closure) have a bound object (namely
> $this)
> - Closures are static if defined within a static method or with the static keyword (static
> function() { ... })
Is it possible to have sample code about these ?
They will be very interesting to understand the RFC correctly and write documentation or tutorial.
For example, i was tryed to use $this in a closure with PHP 5.B beta without any success :/, so if
using $this in a closure is possible, i would like to know how to do it..
Best regards,
Fred
--
========================================================================
Frédéric Hardy : Architecte d'application/Admin. système/Ergonome
CV : http://blog.mageekbox.net/public/cv.frederic.hardy.pdf
Blog : http://blog.mageekbox.net
Twitter : http://twitter.com/mageekguy
========================================================================