PHP itself (without classes) hasn't compile-time constants (and variables). You can define constants only in run-time using define(). This is the reason why this proposal don't try to use constants and variables in namespaces. So ithis approach is absolutely consistent.
BTW you can "import" not only namespace but also class from namespace. <?php namespace A::B; class Foo { const C = 5; } <?php import A::B::Foo; echo Foo::C; I would like to start with this "simple" proposal and may be extend it with constants and variables in the future. Thanks. Dmitry. > -----Original Message----- > From: Stefan Walk [mailto:[EMAIL PROTECTED] > Sent: Friday, July 06, 2007 10:26 PM > To: Dmitry Stogov > Cc: Brian Moon; internals@lists.php.net > Subject: Re: [PHP-DEV] Simple Namespace Proposal > > > On 04/07/07, Dmitry Stogov <[EMAIL PROTECTED]> wrote: > > Nor variables naither constants. > > They are defined in run-time. > > This seems to me like a bit of drawback. Would it be possible > to add compile-time constants, then (like const FOO = 1; > outside a class)? Creating a class inside a namespace for > constants doesn't seem clean to me. > > Regards, > Stefan > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php