Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50642 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42199 invoked from network); 27 Nov 2010 21:58:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2010 21:58:20 -0000 Authentication-Results: pb1.pair.com header.from=mike.vanriel@naenius.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.vanriel@naenius.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain naenius.com designates 83.96.159.14 as permitted sender) X-PHP-List-Original-Sender: mike.vanriel@naenius.com X-Host-Fingerprint: 83.96.159.14 linux35.webawere.nl Linux 2.6 Received: from [83.96.159.14] ([83.96.159.14:35069] helo=linux35.webawere.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/02-29052-8FE71FC4 for ; Sat, 27 Nov 2010 16:58:17 -0500 Received: from 84-107-107-216.dsl.quicknet.nl ([84.107.107.216] helo=[192.168.1.100]) by linux35.webawere.nl with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1PMSm7-0003Xj-JL; Sat, 27 Nov 2010 22:57:44 +0100 To: =?utf-8?Q?Johannes_Schl=C3=BCter?= In-Reply-To: <1290879624.7033.826.camel@guybrush> X-Mailer: iPhone Mail (7E18) References: <1290879624.7033.826.camel@guybrush> Message-ID: <01CEF2CA-065B-47E6-987F-4FB98B9A6F88@naenius.com> Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (iPhone Mail 7E18) Date: Sat, 27 Nov 2010 22:58:51 +0100 Cc: PHP internals list X-Antivirus-Web-Oke.nl: Seems clean. You should still use an Antivirus Scanner Subject: Re: [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations From: mike.vanriel@naenius.com (Mike Van Riel) On 27 nov 2010, at 18:40, Johannes Schl=C3=BCter = =20 wrote: > Hi, > > every now and then while writing classes I forget to add the =20 > "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 =20= > 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/=20 > zend_optional_t_function.diff > FWIW: +1 Though I do have two questions regarding behaviour: I am currently working on a documentation generator (DocBlox) which =20 uses the tokenizer to analyze sourcefiles. The T_FUNCTION token is a =20 clear sign for me that I am dealing with a method (as the visibility =20 token can also be used with properties). With this patch I will loose this recognition point and the first =20 solution that comes to mind is to search for () or arguments. This =20 sounds rather hackish to me, might I be missing a solution? Another question is: when would you like to have this released? PHP-=20 next? (thus either 5.4, 6, 7 or whichever is next?). Thank you! --=20 Kind regards, Mike van Riel=20=