Re: Dropping requirement for `function` keyword for methods in classes/interfaces/etc

From: Date: Wed, 20 Feb 2013 14:05:23 +0000
Subject: Re: Dropping requirement for `function` keyword for methods in classes/interfaces/etc
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Wed, 20 Feb 2013 09:59:51 -0000, Sanford Whiteman <[email protected]> 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
So no you are not saying "PHP is not Java or C#". I don't want to touch any religious views but it's really funny to read :)

Thread (34 messages)

« previous php.internals (#66043) next »