Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77761 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88741 invoked from network); 3 Oct 2014 17:57:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2014 17:57:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=ingwie2000@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ingwie2000@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: ingwie2000@googlemail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:58974] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/9D-10205-C83EE245 for ; Fri, 03 Oct 2014 13:57:32 -0400 Received: by mail-lb0-f170.google.com with SMTP id u10so1452844lbd.15 for ; Fri, 03 Oct 2014 10:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=CyCYZGumcFkSrbSOF5cnKMqzMD+NWPCu6dDHuiE1YVQ=; b=xbwLLCTLLFsjmAXzCBBATzF8PTRl9ysfVQX02huVOLhjFOazzyap2ZKSO3QLNz2r5o 8f8mb/ne1LekiJCUu3300WdDQTeoGjZ5cDTJwgldla0uG9g7+XsWVG/lldYTUcVkDSgn 15ye+n5LlaAusMijsWlEs9kI0ynDDY7NXkzEak0Ne35m9QjUNIxm3fMLO/V6MEdzI31U pM8B1miSkeG2zblhhBurTEjRUYxcDoajvG0d/+Am/G+VQLy6wYAVGJRnth/FqhC9Q6jX u5m7e045Yf2A41PqTYm4EzIThY5442dRH+AOnW1O/p6bOWm9tAp9wIoN8083MrIzbYG7 ooAg== X-Received: by 10.112.63.70 with SMTP id e6mr7235675lbs.92.1412359048856; Fri, 03 Oct 2014 10:57:28 -0700 (PDT) Received: from [192.168.200.103] (dslb-094-219-077-075.094.219.pools.vodafone-ip.de. [94.219.77.75]) by mx.google.com with ESMTPSA id ua3sm2907789lac.35.2014.10.03.10.57.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 10:57:28 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Fri, 3 Oct 2014 19:57:25 +0200 Cc: Thomas Gossmann , internals Content-Transfer-Encoding: quoted-printable Message-ID: <9B6F1F10-7B1D-4FB0-A485-4F1C6202701C@googlemail.com> References: <42.58.10205.32DCE245@pb1.pair.com> To: Levi Morrison X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [PHP7] Remove the function keyword from class methods? From: ingwie2000@googlemail.com (Ingwie Phoenix) Am 03.10.2014 um 19:38 schrieb Levi Morrison : > On Fri, Oct 3, 2014 at 10:21 AM, Thomas Gossmann = > wrote: >=20 >> Hey there, >>=20 >> I'm just a php developer, thus not even having a php.net account. >>=20 >> I was wondering if it is possible to deprecate/remove the function = keyword >> from class methods in php7 or at least make it optional when one of = the >> visibility keywords is present? >>=20 >> I feel like writing a completely unnecessary keyword each time I = write a >> new method for a class. >>=20 >> I guess this was a discussion earlier, though I wasn't able to find >> anything about it. Would love to hear, what pdt-internals (re-)think = about >> that topic. >>=20 >> Thanks, >> gossi >=20 >=20 > Removing the function keyword makes it more difficult for people to = find > method definitions. This has historically been a significant factor in = why > this hasn't been done. >=20 > Also, what does this change actually bring to the table? There is no = actual > benefit to the language or tooling; in fact it probably makes the = tooling > more difficult. All this means is that the user types the function = keyword > less and saves a very, very small amount of time. >=20 > In summary, historically we have felt that the benefits do not = outweigh the > drawbacks. I usually just observe on this list, but this is a topic I have come = across myself. PHP has followed the C++ syntax, and logical scoping like namespace,s = since a long time - if not, eversince. C++ does not use a function = keyword by itself, and even lesser visibility keywords as PHP does. I find it rather ugly seeing =84public function foo()=93 everywhere, = when everybody knows that parantheses mean function. So, I see = readability as a plus. It actually is not a drawback, but rather an enhancement that would = increase PHP=92s readability, in my opinion. It could be introduced as = =84syntactic shuggar=93, where people can, but dont have to, use the = function keyword. For the lexer, this just seems to be one more if(). I don=92t see a lot of evolution in PHP lately, so something small as = this might be pretty nice! :)=