Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62189 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33435 invoked from network); 15 Aug 2012 11:26:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Aug 2012 11:26:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sebastian.krebs.berlin@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:35762] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/D7-30529-0778B205 for ; Wed, 15 Aug 2012 07:26:41 -0400 Received: by eaao11 with SMTP id o11so418166eaa.29 for ; Wed, 15 Aug 2012 04:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:x-google-sender-delegation:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=t36hoIrSWEeHcqFkuWwZ+cnsfvqhEDpqhXLWnkJIRbE=; b=EboXIbYOAyapdqLOs1TmQp03F3OnzY6lTPR7UvhnvnrL3OAudIDNyMQwmKHMQYwGyO P5D1XviQeLAy6Uv4LhetpZe7i+RX1GFqrABGdGaJ2ME9AMx8jCBeZkhyujVFSovlmm7g 7K4+zACPhyuok8QpGBVJL7t0kuaVImCXEAuuCP/NX2ZLaRuC0V5aw3To3iBgh9xnihqz ncXHcq+Kbdab6+hCgAv3ssJe8jMT+vvYnQvkdCHZRxYFsklI6+5pNfHf/pfrkteuXF6b cKr7uVpTM0vw8NnYXkSadSuF/kKww2t15lwOFejaUKII8Cs1TrN2330GfWaLrKLnIuGz dK/w== MIME-Version: 1.0 Received: by 10.14.209.129 with SMTP id s1mr23998267eeo.24.1345029997968; Wed, 15 Aug 2012 04:26:37 -0700 (PDT) Sender: sebastian.krebs.berlin@gmail.com X-Google-Sender-Delegation: sebastian.krebs.berlin@gmail.com Received: by 10.14.176.73 with HTTP; Wed, 15 Aug 2012 04:26:37 -0700 (PDT) In-Reply-To: References: Date: Wed, 15 Aug 2012 13:26:37 +0200 X-Google-Sender-Auth: feXxULyfzCsEw4Q31fLNfjCF1wc Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=047d7b603a783dbd6304c74c3358 Subject: Re: [PHP-DEV] Proposal: use SomeClass::staticMethod From: krebs.seb@gmail.com (Sebastian Krebs) --047d7b603a783dbd6304c74c3358 Content-Type: text/plain; charset=ISO-8859-1 Hi, because it fits into the context (even if it's slightly offtopic): Can I throw in, that I would like to see autoloading for functions? :) Regards, Sebastian 2012/8/15 Nikita Popov > On Wed, Aug 15, 2012 at 12:59 PM, Giedrius Dubinskas > wrote: > > Hello Internals! > > > > I'm just on and off luker here but thought I'll throw in an idea for a > > feature I'd love to see in PHP: aliasing static methods. > > > > Syntax would look something like this: > > > > use Namespaced\SomeClass::staticMethod; > > use Some\Foo::bar as fooBar; > > > > staticMethod(); // would call Namespaced\SomeClass::staticMethod() > > fooBar(); // would call Some\Foo::bar() > > > > This would make code more readable, by removing the the noise of > > repetition of class names. For use cases we can look at Java use cases > > for "import static". > > > > Aliasing class constants like that would also be very nice. > > > > What does everyone think? > > I have the suspicion that you are just using static methods as a way > to group functions into a "namespace". If that's what you want, then > why not just use namespaced functions for that? Should be a lot less > confusing and also semantically more correct. > > Nikita > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b603a783dbd6304c74c3358--