2010/11/27 Johannes Schlüter <johan...@schlueters.de>
>
> Hi,
>
> every now and then while writing classes I forget to add the "function"
> keyword between my visibility modifier and the method name in a class
> declaration. I don't think it is required for readability and it is not
> needed by the parser to prevent conflicts, I therefore propose the
> following RFC incl. patch to allow writing
>
>        class Foo {
>            public bar() {
>                echo "Hello World";
>            }
>        }
>
> Without T_FUNCTION token. In my opinion an access modifier /public,
> private protected, static, final) should still be required for keeping
> readability.
>
> RFC: http://wiki.php.net/rfc/optional-t-function
> Patch: http://schlueters.de/~johannes/php/zend_optional_t_function.diff
>
> johannes
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Considering variables are prefixed and constants don't have visibility
modifiers, functions in classes would still be easily recognizable.
Syntax analyzing IDEs generally don't rely on single keywords and will
be able to adapt a change like this without too much hassle.

On top of that, seeing that functions in classes are generally
referred to as methods, I believe removing the requirement would
improve consistency.

+1 from me.

Kind regards,
Peter Beverloo

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to