Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62184 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26079 invoked from network); 15 Aug 2012 10:59:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Aug 2012 10:59:19 -0000 Authentication-Results: pb1.pair.com header.from=d.giedrius@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=d.giedrius@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: d.giedrius@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gh0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:40765] helo=mail-gh0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 77/36-30529-6018B205 for ; Wed, 15 Aug 2012 06:59:19 -0400 Received: by ghbg24 with SMTP id g24so1757587ghb.29 for ; Wed, 15 Aug 2012 03:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=tMJ+mjfjR8R3qX6pgCoPw6AsY/gEdp+9rrzKhmKeWTY=; b=jJvLIZr86OzwmQGvyqhcEa9BxzgDGHlryIrPEG70YtvNpNecDyS8wujzl4E7BHgM/a Qy8EBYmoe4rcSvetQI+B1zqKFpjn0lSeUYAcGQ2np+Dnicakwld+JiPQiB2Ado2CVNzL xpSazSjzZcVrw2gGsN6LJaciJXGv0BYy3eMx0JfgtEXmdO4ODrVUfIhFntkNUqIs4anp IPiQxWvRvHdmTVxq4phwssOJFnknyevZ9ROqlRAXkJWVTgQEityS61QdrfmxzyucpOQ8 6YdeHfG0PQRTEfK41rn20jI9jmZemm6mTPWmc5JJ8wahlMiHhYGkCw8CXCLiDaRjL8eH MyTQ== MIME-Version: 1.0 Received: by 10.50.184.135 with SMTP id eu7mr17889401igc.15.1345028356223; Wed, 15 Aug 2012 03:59:16 -0700 (PDT) Received: by 10.64.136.45 with HTTP; Wed, 15 Aug 2012 03:59:16 -0700 (PDT) Date: Wed, 15 Aug 2012 13:59:16 +0300 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Proposal: use SomeClass::staticMethod From: d.giedrius@gmail.com (Giedrius Dubinskas) 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? Would it be possible in PHP? -- Giedrius Dubinskas