Re: [PHP7] Remove the function keyword from class methods?
| From: | Kalle Sommer Nielsen | Date: | Fri, 03 Oct 2014 22:03:10 +0000 |
| Subject: | Re: [PHP7] Remove the function keyword from class methods? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77771@lists.php.net to get a copy of this message | ||
Hi
2014-10-03 22:00 GMT+02:00 Arvids Godjuks <arvids.godjuks@gmail.com>:
> Hello internals.
>
> I'm firmly against removing the "function" keyword. PHP is a dynamic
> language, that means that even using the latest most functional IDE's out
> there, finding the implementation is not always few clicks away (PhpStorm's
> "Find Usages") and you need to do a search in the project. And the only
> thing, that makes it fast and easy, is the "function" keyword, because you
> can do a search by "function nameISearchFor" and get a single hit.
>
> I'm not even mentioning the code readability...
I highly doubt THAT many names properties or constants in paticular
with the same name as a method, and honestly, is it that bad to get a
few extra search results? I think that seems like a very thin argument
against this.
For readablity, the only situration I can think of that can create
some fuzzy is something like this;
abstract class A {
b();
}
Abstract class with a method and the visibility modifier omitted,
looks like a function call inside a block of code but that is pretty
much about it, but in a non example type of context, even that would
add more readability to that fuzzy example:
abstract class Driver {
connect($host, $username, $password, $database);
close();
}
Thats for saying, I'm not against removing it, but I'm not in hugely
favor for doing so either, lets call that neutral.
--
regards,
Kalle Sommer Nielsen
kalle@php.net