# Namespaces bug

- Thread: https://externals.io/message/315
- Original archive: https://news-web.php.net/php.internals/315
- Started by Andrei Zmievski on 2003-03-26T18:02:13+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #315 — Andrei Zmievski — 2003-03-26T18:02:13+00:00

URL: https://externals.io/message/315#315

namespace A {
    namespace B{
        class C {
            function D() { print "asdf\n"; }
        }
    }

}

B::C::D();

Apparently, the parser allows nesting namespaces, but they are all
registered as global ones. Should be fixed, I think.

-Andrei                                       http://www.gravitonic.com/

Windows 2000 is certified not to crash more than
once a day, so what is the bootup time, 24 hours?
-- Sam Liddicott

---

## #318 — Stanislav Malyshev — 2003-03-26T18:10:50+00:00

URL: https://externals.io/message/315#318 · In reply to: #315

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.
AZ>> 
AZ>> -Andrei                                       http://www.gravitonic.com/
AZ>> 
AZ>> Windows 2000 is certified not to crash more than
AZ>> once a day, so what is the bootup time, 24 hours?
AZ>> -- Sam Liddicott
AZ>> 
AZ>> 

-- 
Stanislav Malyshev, Zend Products Engineer   
stas@zend.com  http://www.zend.com/ +972-3-6139665 ext.109

---

## #320 — Andrei Zmievski — 2003-03-26T18:16:00+00:00

URL: https://externals.io/message/315#320 · In reply to: #318

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?


> 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. *
