Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78891 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3599 invoked from network); 13 Nov 2014 11:29:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Nov 2014 11:29:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:38403] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1A/11-29190-D0694645 for ; Thu, 13 Nov 2014 06:29:18 -0500 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 80D8147232; Thu, 13 Nov 2014 12:29:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.2 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [172.23.199.103] (unknown [88.214.160.173]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 8EEE94722E; Thu, 13 Nov 2014 12:29:31 +0100 (CET) Message-ID: <1415878147.11005.1.camel@kuechenschabe> To: Robert Stoll Cc: 'Adam Harvey' , 'PHP Internals' Date: Thu, 13 Nov 2014 12:29:07 +0100 In-Reply-To: <001a01cffebf$76f5c2a0$64e147e0$@tutteli.ch> References: <000201cff3b2$37615e50$a6241af0$@tutteli.ch> <001101cffda8$9f56e980$de04bc80$@tutteli.ch> <001a01cffebf$76f5c2a0$64e147e0$@tutteli.ch> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7 From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Wed, 2014-11-12 at 22:27 +0100, Robert Stoll wrote: > That's still perfectly fine because in your code the use statement is not outside of a namespace, it is implicitly in the default namespace. > I am talking about the two following scenarios: > > use \Exception; > namespace test; > > $e = new Exception(); //would fails because test\Exception is unknown -> use was defined outside the namespace > > > Or > namespace a{ > } > > use some\UseDeclaration\which\is\outside\of\AnyNamespace as Useless; // sorry for begin biased ^^ > > namespace test{ > } If I get it rigth this might break code by people who, for whatever reason, combine multiple PHP files into a single one. (cat *.php > full.php && php full.php) johannes