Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78870 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40064 invoked from network); 11 Nov 2014 12:38:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2014 12:38:55 -0000 Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.47 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.192.47 mail-qg0-f47.google.com Received: from [209.85.192.47] ([209.85.192.47:43203] helo=mail-qg0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/00-39904-A5302645 for ; Tue, 11 Nov 2014 07:38:50 -0500 Received: by mail-qg0-f47.google.com with SMTP id j107so7077607qga.34 for ; Tue, 11 Nov 2014 04:38:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=0I43RqXrgba81z+Z+2mDTP9C6CvgXLYFZQACZG2OgKw=; b=Lkau2H5eRoTZToX3j2mmw614RbMbjUHiRd9H50o69YFbu/nkkuPFMDM0ghqAX4Vt2R oONGrBsMixec1CKi+PHlcjYwGgUmNH9xtN9R8vtfoUwv6eFjlKoGQfi1rSqJD0v7vaid mwDi1cOWBgi74BkfMV3o1/sYAu3+05c/ciZ6BWU4PFDan9+P3Z3Srm7jpV8nYxJE7vto oGA4zRPZSmyn5u8cPEyHYkuj5jnDYnCg3RJ9Woj6t3BUsPXhTP1KASqD1xfKSeYCKK+D h6TEVwhY0KK6VwE2Y0pf16VO+HXflnZbADBD8zg+iJLxz8a+kOIDAml6JLAJ555yP+Ff NkLA== MIME-Version: 1.0 X-Received: by 10.224.46.66 with SMTP id i2mr50854846qaf.72.1415709527888; Tue, 11 Nov 2014 04:38:47 -0800 (PST) Sender: are.you.winning@gmail.com Received: by 10.140.239.194 with HTTP; Tue, 11 Nov 2014 04:38:47 -0800 (PST) In-Reply-To: <001101cffda8$9f56e980$de04bc80$@tutteli.ch> References: <000201cff3b2$37615e50$a6241af0$@tutteli.ch> <001101cffda8$9f56e980$de04bc80$@tutteli.ch> Date: Tue, 11 Nov 2014 12:38:47 +0000 X-Google-Sender-Auth: Eg2aztZ61Tk_1jynIAwtpYAQ0_g Message-ID: To: Robert Stoll Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c29e0a83dab10507948f93 Subject: Re: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7 From: cw@daverandom.com (Chris Wright) --001a11c29e0a83dab10507948f93 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11 November 2014 12:11, Robert Stoll wrote: > > -----Urspr=C3=BCngliche Nachricht----- > > Von: Robert Stoll [mailto:php@tutteli.ch] > > Gesendet: Mittwoch, 29. Oktober 2014 20:55 > > An: 'PHP Internals' > > Betreff: [PHP-DEV] forbid use declaration outside of a namespace in PHP= 7 > > > > Heya, > > > > I always found it very ugly that it is possible to define a use outside > of a namespace. Consider the following: > > > > namespace{ //default namespace > > } > > > > use foo\Bar; > > > > namespace test{ > > new Bar(); //error, test\Bar not found } > > > > After some thoughts it is quite clear that Bar is test\Bar and not > foo\Bar inside of the namespace test. But consider > the > > following example which is not so obvious: > > > > use foo\Bar; > > namespace test; > > new Bar(); //error, test\Bar not found > > > > The use declaration looks like a normal use declaration at first glance= . > > I do not see why we should actually support this "feature" any longer > and thus suggest to remove it in PHP 7. > Although, it is > > not a bug (the use declaration is simply ignored as far as I can tell) = I > suppose it confuses the user. > > Nevertheless, even if we declare it as a "feature" I think it should at > least not be a "feature" of the specification > of PHP 7. > > > > Thoughts? > > > > Cheers, > > Robert > > > > > > ps: I first started the discussion @standards, just if you should wonde= r > why it pops up here now as well: > > http://news.php.net/php.standards/528 > > > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List To unsubscribe, > visit: http://www.php.net/unsub.php > > No one else who thinks this "feature" should be removed in PHP 7 ? > > I would say that the lack of anyone saying "no, don't do this" probably means everyone is OK with it. Suggest you work up a patch and PR it, then ping the list to highlight it for further discussion. > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11c29e0a83dab10507948f93--