Re: [PHP7] Remove the function keyword from class methods?

From: Date: Fri, 03 Oct 2014 17:38:12 +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-77760@lists.php.net to get a copy of this message
On Fri, Oct 3, 2014 at 10:21 AM, Thomas Gossmann <mail@gossimaniac.net> wrote: > Hey there, > > I'm just a php developer, thus not even having a php.net account. > > 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. > > Thanks, > gossi Removing the function keyword makes it more difficult for people to find method definitions. This has historically been a significant factor in why this hasn't been done. Also, what does this change actually bring to the table? There is no actual benefit to the language or tooling; in fact it probably makes the tooling more difficult. All this means is that the user types the function keyword less and saves a very, very small amount of time. In summary, historically we have felt that the benefits do not outweigh the drawbacks.

« previous php.internals (#77760) next »