Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10873 invoked from network); 30 Nov 2010 10:00:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2010 10:00:42 -0000 Authentication-Results: pb1.pair.com header.from=patrick.allaert@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=patrick.allaert@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:39320] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/75-01713-B3BC4FC4 for ; Tue, 30 Nov 2010 05:00:32 -0500 Received: by eyf5 with SMTP id 5so2573354eyf.29 for ; Tue, 30 Nov 2010 02:00:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=iSGVixHjj0kyMpyEscgz7BwdExkrwLAZjcUCvKZ+tAE=; b=GZE/mU6xFvlRFoHEOUeTpJB5ePYCf7c95XIlh6YUiIJ5D0tjaf5+myhrTTFAiWUNA0 K4hNQ3Z5kyGiFkefuLFoS24WIETuJV3aWnxg7U55UOENMN+hJKdkch9xNfNvM1oD3sZH 1p+xjRNfuAGP+fefVR3JTlzYkutdx+fCs/3PI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=V6wObA1qpsUpMvlm+7icvI5hBMRweHjmYc7B6A3bA0ybYbAjGPJEZdwUEbPDWitvAz Pau6wJNTpzg5g0OzwAGBcN3WPDgskLm9FWrpbmifxxXQnEKd/DRtaDCuzJEkEm00YRLR AZAWhQ9ueeqEPM9qqw7JdnsGSYsjbtIfwntK4= MIME-Version: 1.0 Received: by 10.213.15.132 with SMTP id k4mr52320eba.94.1291111206894; Tue, 30 Nov 2010 02:00:06 -0800 (PST) Sender: patrick.allaert@gmail.com Received: by 10.213.4.201 with HTTP; Tue, 30 Nov 2010 02:00:06 -0800 (PST) In-Reply-To: <1290879624.7033.826.camel@guybrush> References: <1290879624.7033.826.camel@guybrush> Date: Tue, 30 Nov 2010 11:00:06 +0100 X-Google-Sender-Auth: xSaj6dwVTCjVU5KmrYNNyUwlFNQ Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: PHP internals list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations From: patrickallaert@php.net (Patrick ALLAERT) 2010/11/27 Johannes Schl=C3=BCter : > 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 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0class Foo { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0public bar() { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo "Hello World"= ; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} > =C2=A0 =C2=A0 =C2=A0 =C2=A0} > > 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 With this patch, something looks inconsistent to me: Both properties and methods have a visibility (public|protected|private) and a keyword: "var" (T_VAR) and "function" (T_FUNCTION) respectively. However "private var $foo;" generates a fatal error but "private function foo(){}" not? Cheers, --=20 Patrick Allaert --- http://code.google.com/p/peclapm/ - Alternative PHP Monitor