Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78890 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 889 invoked from network); 13 Nov 2014 10:58:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Nov 2014 10:58:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wg0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:53513] helo=mail-wg0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/A0-29190-BBE84645 for ; Thu, 13 Nov 2014 05:58:03 -0500 Received: by mail-wg0-f41.google.com with SMTP id l18so1061519wgh.28 for ; Thu, 13 Nov 2014 02:58:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=3XHHSIqSCrL/mqjsRnI8Ca+azMZZl1kv22LtXYNJeR4=; b=gw7sK+K3cIBb1wjwNArxJNGrhK9cl0+vpobSr5wsqfo5akpS7+lCG92lcCzQGvoHuz ih9AtUA0/0fAYFGk53CHxPGi8raB488gh83KCP4UL+6bQGX8Nb5R145oJNQCjW714FUz 4jpgmw5fAH9CotgqQT3jhmdHjmHS4TcbdWwlRZlVJqUWSgzbeViyZz6Dw2PZeVhYBj+C VVYFwL8jW2Jee/btFAbXB/LJ/bA9CU3kflhadnakUlB/+4a3zTM/Ss9uX8HN6cWeQ07Z sT47nuB59wlqcWxMd/XELaPrWjjlCFeu4oDzQZQD9szo/GQPgqtcGbhr5fDrAQgHoNk6 k05g== X-Received: by 10.180.149.129 with SMTP id ua1mr2608302wib.73.1415876280448; Thu, 13 Nov 2014 02:58:00 -0800 (PST) Received: from [192.168.0.148] ([62.189.198.114]) by mx.google.com with ESMTPSA id r10sm5716807wiy.13.2014.11.13.02.57.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 02:57:59 -0800 (PST) Message-ID: <54648E94.5060802@gmail.com> Date: Thu, 13 Nov 2014 10:57:24 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <000201cff3b2$37615e50$a6241af0$@tutteli.ch> <001101cffda8$9f56e980$de04bc80$@tutteli.ch> <001a01cffebf$76f5c2a0$64e147e0$@tutteli.ch> In-Reply-To: <001a01cffebf$76f5c2a0$64e147e0$@tutteli.ch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: AW: [PHP-DEV] forbid use declaration outside of a namespace in PHP 7 From: rowan.collins@gmail.com (Rowan Collins) Robert Stoll wrote on 12/11/2014 21:27: > 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. Surely if that's true of Adam's example, it's true of yours as well? > namespace a{ > } > > use some\UseDeclaration\which\is\outside\of\AnyNamespace as Useless; // sorry for begin biased ^^ > > namespace test{ > } This scenario looks identical to Adam's to me, unless you propose to look at the entirety of the file to detect if there is something other than a use statement in the default namespace. For that matter, what about this: use GuzzleHttp\Client; include __DIR__.'/vendor/autoload.php'; $client = new Client; // $client is a GuzzleHttp\Client object namespace Foo; $client = new Client; // $client is a Foo\Client object Certainly this code is not *sensible*, but it does have a meaningful behaviour, which derives directly from the previous examples and documented uses of the namespace keyword. I'm not sure how you'd distinguish between the various combinations here. Regards, -- Rowan Collins [IMSoP]