Re: Re: PHP 5.1 (Or How to break tousands of apps outthere)
| From: | Jessie Hernandez | Date: | Mon, 28 Nov 2005 19:59:21 +0000 |
| Subject: | Re: Re: PHP 5.1 (Or How to break tousands of apps outthere) | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-20753@lists.php.net to get a copy of this message | ||
Stas,
I agree that namespace constants are not needed, and are even problematic.
If I import a namespace that is divided among several files and I use a
constant from that namespace, __autoload won't let me find, and I won't know
where it is either. It's better to have a "Config" class under the namespace
that contains all the constants needed, and this class can be autoloaded if
used.
Using the same line of reasoning, what can you do with a simple function in
a namespace that you can't do with a static method in a class inside that
namespace? If we scrap functions also, then we can use the ":" operator and
everything will be simple.
Anyways, if ":::" is not accepted and I can't make namespace constants work
in the ternary with ":", then I'm simply going to remove them.
Regards,
Jessie
"Stanislav Malyshev" <stas@zend.com> wrote in message
news:Pine.LNX.4.62.0511282146170.31821@shire.zend.office...
> MB>>brains sooner or later. On the other hand \ has a clear visible split
> MB>>meaning. That is all the namespace operator must have besides not
>
> Yes, except that it is used as escape character in a dozen of languages or
> more and automatically recognized as such by any experienced programmer,
> who would instantly think "WTF is \n doing inside an identifier???"
>
> MB>>Btw, during paris meeting we thought that: "Constants in name spaces
> MB>>are allowed unless we find problems with the implementation".
>
> I don't see any reason why they should be needed. What you can do with
> them that you can't do with class constants?
>
> --
> Stanislav Malyshev, Zend Products Engineer
> stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115