Re: [PHP7] Remove the function keyword from class methods?
| From: | Andrea Faulds | Date: | Fri, 03 Oct 2014 20:57:47 +0000 |
| Subject: | Re: [PHP7] Remove the function keyword from class methods? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77768@lists.php.net to get a copy of this message | ||
On 3 Oct 2014, at 17:21, Thomas Gossmann <mail@gossimaniac.net> wrote:
> I was wondering if it is possible to deprecate/remove the function keyword from class methods
> in php7 or at least make it optional when one of the visibility keywords is present?
>
> I feel like writing a completely unnecessary keyword each time I write a new method for a
> class.
>
> I guess this was a discussion earlier, though I wasn't able to find anything about it.
> Would love to hear, what pdt-internals (re-)think about that topic.
Me and Pierre have discussed this before, Pierre was in favour of it last time we talked about it.
I’d certainly be in favour of allowing
function to be omitted when there’s a
visibility specifier, like so:
public foo() {}
public static foo() {}
Easy to implement, too. What are the list’s thoughts? I don’t think it really hampers
readability much.
--
Andrea Faulds
http://ajf.me/