On 10 Aug 2014, at 22:00, Rowan Collins <rowan.coll...@gmail.com> wrote:
> You're rather pre-supposing the proposed syntax there, and letting it lead > the semantics rather than vice versa. The point is it would be useful to > allow creation of a pre-bound closure based on an existing method, so it > would be good if the syntax allowed that possibility. Huh? I’m saying it should do the same thing calls do for the sake of consistency. It’d be nice if (&$foo->method) could work, but sadly it doesn’t. > Getting a static reference to a non-static method and then binding it feels a > bit like JS, which has a completely different notion of what a method is. JavaScript’s methods are bound based on what object they’re used on. PHP’s methods are statically bound. That’s not quite the same thing at all. >> Using the ‘Closure’ class is unfortunate, but I don’t really want to >> make unnecessary new Function/Method/etc. classes given they’d all >> share the same implementation anyway. > > I'm not so sure they'd be identical - a static method or plain function would > presumably error if you tried to bind it, for instance. So do static closures, as I’ve already mentioned. I don’t really see what’s wrong with using our existing class for functions. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php