News for hackers. Stuff that matters.
Re:What to Look For in PHP 5.4 by zombielifestyle on Wednesday December 21, 2011 @09:40AM (#3377601)
Closure::bindTo gives a nice js-like feeling, but i wonder why the hell a invocation of a closure in a class member triggers a warning.
Re:What to Look For in PHP 5.4 by TomNomNom on Wednesday December 21, 2011 @10:19AM (#3377735)
Class/object members and methods do not share a "namespace", so it's possible to have a method and a member with the same name. If you assigned a closure to a member that had a colliding method, PHP wouldn't know which one to execute.

I'm guessing this is at least some of the reason for that behaviour.

You can force it to work in the absence of a collision by using a __call override. An example of which can be seen here: https://github.com/TomNomNom/Talk---New-stuff-in-PHP-5.4/blo...

Re:What to Look For in PHP 5.4 by zombielifestyle on Wednesday December 21, 2011 @10:43AM (#3377827)
Didn't think of that, pretty obvious now. ty :)