Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78446 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81792 invoked from network); 29 Oct 2014 19:55:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Oct 2014 19:55:06 -0000 Authentication-Results: pb1.pair.com header.from=php@tutteli.ch; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@tutteli.ch; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain tutteli.ch designates 80.74.154.78 as permitted sender) X-PHP-List-Original-Sender: php@tutteli.ch X-Host-Fingerprint: 80.74.154.78 ns73.kreativmedia.ch Linux 2.6 Received: from [80.74.154.78] ([80.74.154.78:58587] helo=hyperion.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/F0-09383-61641545 for ; Wed, 29 Oct 2014 14:55:04 -0500 Received: (qmail 31869 invoked from network); 29 Oct 2014 20:54:57 +0100 Received: from unknown (HELO RoLaptop) (80.66.46.208) by ns73.kreativmedia.ch with ESMTPSA (AES128-SHA encrypted, authenticated); 29 Oct 2014 20:54:56 +0100 To: "'PHP Internals'" Date: Wed, 29 Oct 2014 20:54:56 +0100 Message-ID: <000201cff3b2$37615e50$a6241af0$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: Ac/zsZ+n0Td75tEGQH6FuL7Jra3u4g== Content-Language: de-ch Subject: forbid use declaration outside of a namespace in PHP 7 From: php@tutteli.ch ("Robert Stoll") 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 wonder why it pops up here now as well: http://news.php.net/php.standards/528