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

From: Date: Wed, 20 Feb 2013 10:38:26 +0000
Subject: Re: Dropping requirement for `function` keyword for methods in classes/interfaces/etc
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
> 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.

No, if you *only* allow inner classes at any point, you don't have
ambiguity. So by your standard, that version of PHP should drop the
keyword because there's only one unambiguous "something{}"
construction in that context.

I'm not saying you _should_ drop the keyword, I'm just explaining what
I think is the slippery slope of this kind of non-improvement. 

> 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.

I don't think you followed the matter of complex search/replace and
the new regex you'd have to "just" use all the time. I use a
sophisticated IDE as I mentioned, but its s/r function is separate
from its "find declaration" function. Not to mention searching for
duplicate declarations or in files you don't have in your workspace.
This is a real problem and I'm very happy we don't have it now.

> No voting karma here as well but I do tons of code reviews and this is
> just my opinion, you know, from the userland.

I am debating from userland as well. But I'm all done w/this one.

-- S.



Thread (34 messages)

« previous php.internals (#66050) next »