RE: [PHP-DEV] Simple Namespace Proposal

From: Date: Mon, 09 Jul 2007 07:38:55 +0000
Subject: RE: [PHP-DEV] Simple Namespace Proposal
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-30643@lists.php.net to get a copy of this message
On Sun, July 8, 2007 2:58 am, Dmitry Stogov wrote: > -1 for braces and multiple namespaces per file > > Braces will allow define something outside namespace and I like to > avoid > this possibility. > In the following "correct" example function bar() is defined in global > namespace. > > <?php > namespace A::B { > > function foo() { > } > > } > > function bar() { > } > ?> +1 for braces. <?php function super_common_function_every_namespace_in_my_project_uses(){ } namespace A::B { function foo() { //arcana of A::B stuff } } ?> This, to me, is not an unreasonable code layout, other than the ridiculous function name. If you want to document "namespaces will never be nested" from the get-go, that would be fine, of course. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.internals (#30643) next »