Sandy, On Wed, Feb 20, 2013 at 11:59 AM, Sanford Whiteman <swhitemanlistens-softw...@cypressintegrated.com> wrote: >> Classes always should be declared with class keyword, because there could >> be ambiguity whether it's class, interface or trait. > > If only inner classes are allowed in a given PHP version, there's no > ambiguity about whether "something{}" just inside a a class is an > inner class. > > That's the justification for removing "function" just inside classes, > isn't it? That it's not ambiguous because the only thing as of PHP.now > that can take the form "sometype somevisibility something(){}" is a > function? > > Well, if in PHP.later, the only thing that takes the form "sometype > something{}" is an inner class, then leaving off the "sometype" there > is also unambiguous (but also similarly gratuitous). > > And if in PHP.later.still you have inner interfaces, then the > unmodified one still defaults to inner class and only a literal > "interface something{}" is an inner intf. > > (I'm attempting a RAA argument but maybe failing....) > > -- Sandy | FigureOne Support Team >
I think you've abstracted this one way too much. For me right now all I see is a useless keyword in a class. We don't have 'visbilitytype var/property $varName' right now but you are comfortable with them knowing that they are just properties of the class. If I were to be on this road I could in fact argue that currently we have a lack of consistency between class methods and properties. You can have a look on this image if you want an example: http://i.imgur.com/Q0ZOZns.png For the part where public is optional, I think that most frameworks and practices they promote and users actually do type the keyword and have it there for the sake of consistency. It might not be the case for now, but I think that it would rather be useful to enforce the visibility types rather that the 'function' keyword. As for classes/interfaces/traits and so on, if they are ever added in PHP to be declared inside classes and so on then I see no issues with this. A class/interface or a trait keyword would still be needed to make the difference between a them imho. Grepping for sources is like a daily operation and by using IDEs like Netbeans/Eclipse/PHPStorm one has the ability to just search for a symbol directly, regardless if you can click of function name or not. No voting karma here as well but I do tons of code reviews and this is just my opinion, you know, from the userland. Regards. ---- Florin Patan https://github.com/dlsniper -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php