Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84382 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92982 invoked from network); 6 Mar 2015 14:40:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Mar 2015 14:40:14 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.215.45 mail-la0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:43606] helo=mail-la0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/71-16282-D4CB9F45 for ; Fri, 06 Mar 2015 09:40:14 -0500 Received: by labgf13 with SMTP id gf13so33413966lab.10 for ; Fri, 06 Mar 2015 06:40:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+9u6sqUHglwifVun5mCH+OgqwZ1h142orKA7QQtKDdg=; b=wDl8t+b/p2JyaLJBiyBkfNLAIJn53fI2OUsoyUy3d8bIE2kCSeG7+RpsRhZVvo0mnT TteEhf3ZwqC8FwziRD4uudT0dhsOdpxbXKUNHn/P13p00UCQ0HMIvcHOuq0mLUVRFjUJ K3j942R2fohEI16c2X/9k1MKAjJlMaFcBC2AXT9k3elMfkT5QUKAz7fKGTyc3/0Kjeup 5XfJ7Uas26FGO3rKQE8On6ydKyElCXNIqC/FNXam+uQWZmPxRxrpSbKRywGo1ROuu1kv +aP+zPawF3yFT8EsgjMk5/Y3eOi2pyjY5jGeRdcFXh/f4wCHv6OMNtFTTBHBtYVOxTxB FQVg== MIME-Version: 1.0 X-Received: by 10.112.54.165 with SMTP id k5mr12592146lbp.57.1425652810295; Fri, 06 Mar 2015 06:40:10 -0800 (PST) Received: by 10.25.43.9 with HTTP; Fri, 6 Mar 2015 06:40:10 -0800 (PST) In-Reply-To: References: Date: Fri, 6 Mar 2015 09:40:10 -0500 Message-ID: To: Lee Davis Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Use behavior thoughts From: ircmaxell@gmail.com (Anthony Ferrara) Lee, On Fri, Mar 6, 2015 at 7:06 AM, Lee Davis wrote: > > Hi Anthony. > > This issue that has plagued me in the past, specifically with the use of > traits: > > Error: http://3v4l.org/VFguK > OK: http://3v4l.org/73b86 > > Although when combined with opcache does causes very confusing behaviour, I > do worry that removing the error altogether may make it worse for > developers. > > Take this example with constants: > > namespace Biz { > const Bar = 41; > } > > namespace Foo { > const Bar = 42; > } > > namespace Foo { > use const Biz\Bar; > echo Bar; > } > > // Fatal error: Cannot use const Biz\Bar as Bar because the name is already > in use > > http://3v4l.org/0pRZk > > An error here is far more useful that trying to exhibit the behaviour of > when the namespaces are declared in reverse order: > > namespace Biz { > const Bar = 41; > } > > namespace Foo { > use const Biz\Bar; > echo Bar; > } > > namespace Foo { > const Bar = 42; > } > > // 41 > > http://3v4l.org/E4PFX > > I suppose the question here is; Does the declaration order matter? > Personally I think it should. If we were just talking about a single file, yes. However, we're also talking about file include order.