====== Request for Comments: Making T_FUNCTION optional for method declarations ====== * Version: 1.0 * Date: 2010-11-27 * Author: Johannes Schlüter * Status: Inactive * First Published at: http://wiki.php.net/rfc/optional-t-function ===== Introduction ===== The purpose of this RFC is proposing to remove the requirement of T_FUNCTION keyword in method declarations if a visibility flag (T_PUBLIC,T_PROTECTED, T_PRIVATE, T_STATIC, T_ABSTRACT, T_FINAL) is given in a class, trait or interface declaration. ===== Syntax ===== It is proposed that this is valid code: class Foo { const C = 42; private $var; public bar() { echo "Hello World"; } } $foo = new Foo(); $foo->bar(); While technically possible this RFC suggests that the following shall **NOT** be valid for keeping the code readable: class Foo { const C = 42; private $var; bar() { echo "Hello World"; } } $foo = new Foo(); $foo->bar(); ===== Patch ===== An initial patch can be found at http://schlueters.de/~johannes/php/zend_optional_t_function.diff ===== Changelog ===== 1.0: Initial proposal (JS)