Re: [PATCH] allowing multiple namespaces per file plus namespaces with brackets
| From: | Gregory Beaver | Date: | Tue, 21 Aug 2007 19:03:02 +0000 |
| Subject: | Re: [PATCH] allowing multiple namespaces per file plus namespaces with brackets | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-31805@lists.php.net to get a copy of this message | ||
Larry Garfield wrote:
> Greg: You say that the old java-package-style definition still works, in
> addition to braces. I presume then that the following are equivalent:
>
> <?php
> namespace foo;
>
> class Bar {
> ...
> }
> ?>
>
> <?php
> namespace foo {
> class Bar {
> ...
> }
> }
> ?>
>
> What happens if you mix them?
>
> <?php
> namespace baz;
>
> namespace foo {
> class Bar {
> ...
> }
> }
> ?>
compiler error - if you use namespace OneToRuleThemAll; then you can't
additionally use namespace another {}
> Would the compiler have a heart attack if someone did:
>
> <?php
> namespace foo {
> namespace baz {
> class Bar { ... }
> }
> }
> ?>
compiler error
Greg