Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78889 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60297 invoked from network); 12 Nov 2014 21:27:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Nov 2014 21:27:36 -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:39847] helo=hyperion.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/80-54468-7C0D3645 for ; Wed, 12 Nov 2014 16:27:36 -0500 Received: (qmail 24784 invoked from network); 12 Nov 2014 22:27:31 +0100 Received: from cm56-129-238.liwest.at (HELO RoLaptop) (86.56.129.238) by ns73.kreativmedia.ch with ESMTPSA (AES256-SHA encrypted, authenticated); 12 Nov 2014 22:27:31 +0100 To: "'Adam Harvey'" Cc: "'PHP Internals'" References: <000201cff3b2$37615e50$a6241af0$@tutteli.ch> <001101cffda8$9f56e980$de04bc80$@tutteli.ch> In-Reply-To: Date: Wed, 12 Nov 2014 22:27:29 +0100 Message-ID: <001a01cffebf$76f5c2a0$64e147e0$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIPPXtbPZBTwayAd3/waoyNKhChzAEtjs3+AdXjotKbxucgkA== Content-Language: de-ch Subject: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7 From: php@tutteli.ch ("Robert Stoll") =20 > Sorry, I apparently missed this the first time. Would this mean that = this sort of script (where we're using use statements > without a > namespace) would no longer work? >=20 > use GuzzleHttp\Client; >=20 > include __DIR__.'/vendor/autoload.php'; >=20 > $client =3D new Client; > // $client is a GuzzleHttp\Client object ?> >=20 > Because that strikes me as an irritating and unnecessary BC break for = people who are writing throwaway scripts (with no > need to live in > namespaces) that pull in namespaced libraries to me. >=20 > Adam >=20 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 =3D 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{ } Cheers, Robert