2013/9/23 Derick Rethans <der...@php.net> > On Mon, 23 Sep 2013, Joe Watkins wrote: > > > https://wiki.php.net/rfc/anonymous_classes > > This RFC misses one very important part: an argument for why this > feature is useful. Syntax changes are likely to be extremely contentious > and without convincingreasoning *why* we need this, we shouldn't even > consider looking at an RFC. > > I use anonymous classes very frequently in Java and in C#, and I would say that they are quite useful. However the examples given in the RFC are really bad ones. Why on earth would you need a constructor for an anonymous class? Anonymous classes are used to implement quickly some interface. Frankly, constructors are not part of any interface. Besides a constructor is totally useless in an anonymous class as it will never be called after the object is created.
Let's not rule out this feature yet. It's just a weak RFC, so let's wait for better approaches. Lazare INEPOLOGLOU Ingénieur Logiciel