Couldn't you make the same argument for:

  function A() {
    function B() {
    }
  }

This has worked for years and both A() and B() become global functions.

-Rasmus

On Wed, 26 Mar 2003, Andrei Zmievski wrote:

> Care to explain a little more? I think allowing this syntax is very
> confusing for the user.
> 
> I can see the point of this:
> 
> namespace A {
>    class B {
>     ...
>    }
> }
> 
> ...
> 
> namespace A {
>    class C {
>     ...
>    }
> }
> 
> But not in the example below. People would basically expect to have
> nested namespaces, which we don't have, so why lead them on?
> 
> On Wed, 26 Mar 2003, Stanislav Malyshev wrote:
> > Noting to fix. This is by design. 
> > 
> > AZ>> namespace A {
> > AZ>>     namespace B{
> > AZ>>         class C {
> > AZ>>             function D() { print "asdf\n"; }
> > AZ>>         }
> > AZ>>     }
> > AZ>> 
> > AZ>> }
> > AZ>> 
> > AZ>> B::C::D();
> > AZ>> 
> > AZ>> Apparently, the parser allows nesting namespaces, but they are all
> > AZ>> registered as global ones. Should be fixed, I think.
> 
> -Andrei                                       http://www.gravitonic.com/
> * The great thing about standards is that there are so many to choose from. *
> 
> 


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to