Re: Simple Namespace Proposal
| From: | Stefan Priebsch | Date: | Thu, 05 Jul 2007 08:36:04 +0000 |
| Subject: | Re: Simple Namespace Proposal | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-30454@lists.php.net to get a copy of this message | ||
Hi Dmitry,
thanks for your clarifications. I like your concept very much, as a PHP
user, however, I am a little concerned about some ambiguities your
concept introduces. I feel this might be a source of error for many
programmers, especially less experienced ones.
> In any case you won't use classes and namespaces with the same full names.
IMHO this should be a fatal error, at least a warning (something like
"potential ambiguity between funtion foo() in namespace a and abstract
method foo() in class a". Otherwise adding to an existing program could
inadvertedly alter its behaviour.
> Right. You can have namespace UTF8 and function strlen() in it.
This kind of "overriding" would make an interesting feature! However, if
a programmer creates - by coincidence - a method with the name of an
built-in PHP function, he alters the program's behaviour; from another
point of view, this is something that should be forbidden, as I think it
could be a source of hard-to-find errors.
Kind regards,
Stefan
--
>e-novative> - We make IT work for you.
e-novative GmbH - HR: Amtsgericht München HRB 139407
Sitz: Wolfratshausen - GF: Dipl. Inform. Stefan Priebsch
http://www.e-novative.de