Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39009 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80049 invoked from network); 16 Jul 2008 15:30:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2008 15:30:50 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:6707] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/56-54589-8241E784 for ; Wed, 16 Jul 2008 11:30:49 -0400 Received: from [10.1.10.7] ([10.1.10.7]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 16 Jul 2008 18:31:15 +0300 Message-ID: <487E141E.7070401@zend.com> Date: Wed, 16 Jul 2008 19:30:38 +0400 User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Stefan Priebsch CC: internals@lists.php.net References: <1216138090.15841.11.camel@steve-laptop> In-Reply-To: <1216138090.15841.11.camel@steve-laptop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 16 Jul 2008 15:31:16.0335 (UTC) FILETIME=[FCBB97F0:01C8E758] Subject: Re: [PHP-DEV] Namespace problem? From: dmitry@zend.com (Dmitry Stogov) The "use" can be used only as top-level statement. Thanks. Dmitry. Stefan Priebsch wrote: > Hi list, > > I was playing around with namespaces and stumbled across this: > > #!/home/steve/php5.3-200807070430/sapi/cli/php > > namespace Foo; > > use Foo::Bar as Something; > > class Bar { } > > ?> > > works fine, whereas > > #!/home/steve/php5.3-200807070430/sapi/cli/php > > namespace Foo; > { > use Foo::Bar as Something; > > class Bar { } > } > > ?> > > yields: Parse error: syntax error, unexpected T_USE > in /home/steve/namespaces/code/with_braces.php on line 6 > > Regards, > > Stefan >