Richard Quadling wrote:
How much of a use case is binding $this to closures (personally, I
think this is quite a common usage, but I've been using JavaScript so
maybe I've got the wrong head on).
But, if there are significant technical/internal issues with regard to
binding $this to closures, what about (and I'm expecting the usual
shoot down here as I obviously know squat) NOT binding closures at all
(option 0).
Instead get traits working.
*snip*
If I recall the trait discussion properly, traits are a compile-time
thing. Closure binding is a run-time thing. They are not comparable
and one cannot really be used to implement the other. (Well,
hypothetically bound closures could kinda-sorta replicate traits, but it
would be a pretty lousy way of doing it as you get no compile-time
enforcement or interface support.)
--Larry Garfield
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php