Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66025 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42824 invoked from network); 20 Feb 2013 08:24:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2013 08:24:23 -0000 Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.172 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.217.172 mail-lb0-f172.google.com Received: from [209.85.217.172] ([209.85.217.172:46271] helo=mail-lb0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/A3-19387-73884215 for ; Wed, 20 Feb 2013 03:24:23 -0500 Received: by mail-lb0-f172.google.com with SMTP id n8so5821592lbj.31 for ; Wed, 20 Feb 2013 00:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:content-type:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=o1cC8EUG+eR81htVNW/TefHPC+ZQI/lpgN6lmh7BW4o=; b=CeZCJSS5cwjmBapNHZ2iyd06KPnIG6a9NnLGLwB3vs9Ifl56rbv5q4KxyVimU/DQGN UeVE9fCq0ewUrkvMtTm1ZrkpzTbcMxMlwelQMyhpMSZ+u4ZD7m1lvxUQH1WUb1u2uSGK CJJxg81WqwbAvhh4xF5QuoTssxXfiPRhKeE8YJ91NoSCLx+yiCnbZHpOAk8Q8oQdiLTu 6TNyOJr1NWIknY3t+Kkq3XK/qN4oeNFEELddh69e7o2WAwfZd7t04Hvg7RfmDkFxl+k+ yxWrmIdG96ncL6T+xEESiYj1Hn2uIwCzS7w4/9TyMhyKO6HLSkcmkwKEUV4XHeC2SAgF zmWg== X-Received: by 10.112.105.196 with SMTP id go4mr3510340lbb.35.1361348660244; Wed, 20 Feb 2013 00:24:20 -0800 (PST) Received: from nikita2206-debian (37-144-174-250.broadband.corbina.ru. [37.144.174.250]) by mx.google.com with ESMTPS id xw14sm23024209lab.6.2013.02.20.00.24.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 Feb 2013 00:24:19 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: internals@lists.php.net, "Sanford Whiteman" References: <-1452447624906595030@unknownmsgid> <51240F9D.8020409@lerdorf.com> <591203797.20130219192444@cypressintegrated.com> <4995898.20130220030236@cypressintegrated.com> Date: Wed, 20 Feb 2013 12:24:18 -0000 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <4995898.20130220030236@cypressintegrated.com> User-Agent: Opera Mail/12.14 (Linux) Subject: Re: [PHP-DEV] Dropping requirement for `function` keyword for methods in classes/interfaces/etc From: inefedor@gmail.com ("Nikita Nefedov") On Wed, 20 Feb 2013 08:02:36 -0000, Sanford Whiteman wrote: > While I'm thinking about this (though I should leave it alone): who's > to say that PHP won't some day get inner classes? By deciding the > "default" inner member of a class will be a function, you're choosing > the one that has a global/procedural equivalent where the short syntax > won't work, instead of leaving the concept unused for the possible > future when: > > class myClass { > mySomething { // is equivalent to class mySomething { > (Yes, you could say mySomething(...) { } is a public function and > mySomething { } is an innner class, but you get the idea.) > > -- S. > > Classes always should be declared with class keyword, because there could be ambiguity whether it's class, interface or trait. Also, I will say it again: as Sara noted, we *really* shouldn't let users define methods without any modifiers, like this: class Foo { asd() { echo "this is parse error"; } }