Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68288 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93224 invoked from network); 23 Jul 2013 20:43:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2013 20:43:38 -0000 Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.182 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 74.125.82.182 mail-we0-f182.google.com Received: from [74.125.82.182] ([74.125.82.182:41340] helo=mail-we0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/00-26646-8FAEEE15 for ; Tue, 23 Jul 2013 16:43:37 -0400 Received: by mail-we0-f182.google.com with SMTP id u55so2737144wes.41 for ; Tue, 23 Jul 2013 13:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=5H9wfmR8eOrBtxHkDAVfmzEZWmu/6EjBBEgDAuAYhzo=; b=FHPFYPYMrLG5K5KGHApmd5rnhF0PFr/b15gsm+/YahixDIK5NDkvxDc4S0ONEk+sIk C5XhWdvqltzock2RkpOdkcgfz+/ljoGI9nkhEKyUVazGG5uYXfvtrl2+MaXDCl7EEWP5 EYCWI+SPKe7yRUEuTCSuVCzCHWm8T88xQmoMzkZ0ciiJVrWHlaqd1vrsvJ/+I/2dwgeW 5J23jQvIk1XBqr3bCgycj/Ig656TSWIuYym/X//xpnwmdKxVMP9m3JytjyM2LC7yDpvC qmG80CabOs0xeMbgbTOMCGzs7PiSifbMnL3ni35arBGJkQGnSKAOjwtc4AIFanXUROI9 wdbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=5H9wfmR8eOrBtxHkDAVfmzEZWmu/6EjBBEgDAuAYhzo=; b=o+0E7pxiBp7J+ZIP7cA1sULVjWgVF20/K6bCx2+DZkqK6M9kXdG9zFWQR9wMed2Qh5 6kCVbVUOiy1NEgosVxe6jbLPwew8jvtxMls0bc63abw9Ef92MQX/jHtpz62ZRErqfr2C aewaWf9HHZqseEX5wy8+8yNRXrgHbiGMYOE/eQamA1VgXl60PKK7oDSyB+chuRLFH77D 4qVQvVt34jh5Z6lpRal5dIS/r5Up3bOHN4TZyzpiQTqZ1rphNK/7FJAly+a3Sx3X499l AJURLFjmKzcwRxrilrpUKVYDMG0uHSDWxIQmr8lKbWmnJnNsVLutXZJY4el4uiSHNVlw FAFQ== X-Received: by 10.180.14.105 with SMTP id o9mr343444wic.30.1374612213602; Tue, 23 Jul 2013 13:43:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.5.9 with HTTP; Tue, 23 Jul 2013 13:42:53 -0700 (PDT) In-Reply-To: <403E6D88-8057-48F1-A742-73D026CB1760@wiedler.ch> References: <60BF8DD5-FEEA-47D9-834F-6C7FDEF3B879@wiedler.ch> <403E6D88-8057-48F1-A742-73D026CB1760@wiedler.ch> Date: Tue, 23 Jul 2013 22:42:53 +0200 Message-ID: To: Igor Wiedler Cc: PHP internals list Content-Type: multipart/alternative; boundary=f46d040fa1d4b220b104e233d870 Subject: Re: [PHP-DEV] [RFC] Importing namespaced functions From: krebs.seb@gmail.com (Sebastian Krebs) --f46d040fa1d4b220b104e233d870 Content-Type: text/plain; charset=ISO-8859-1 Hi, Thanks for that. But actually I don't see: Why is "use" not enough? As far as I can see your example, why it would introduce a BC, doesn't really match to original question, why "use function" is used. Especially I don't see any ambiguity: foo(); // Always a function. You cannot call classes this way new foo(); // always a class foo::bar(); // Always a class But the example I mentioned before namespace { function bar() {}} namespace foo { function bar() {}} namespace { use foo\bar; bar();} points to a different problem, which I didn't see solved by adding the "function"-keyword to "use". Can you clarify this? Because I'd try to avoid new syntax wherever possible. Regards, Sebastian 2013/7/23 Igor Wiedler > Hi, > > Based on Sebastian's feedback I have updated the RFC and the patch to > include a `use const` sequence that works just like `use function`, but for > namespaced constants. > > Example usage: > > namespace foo\bar { > const baz = 42; > } > > namespace { > use const foo\bar\baz; > var_dump(baz); > } > > I also fixed some other issues that the original patch had in the process > (see commit history). Please keep the feedback coming. > > Thanks, > > Igor > > -- github.com/KingCrunch --f46d040fa1d4b220b104e233d870--