Re: Namespace separator constant
| From: | Kalle Sommer Nielsen | Date: | Tue, 10 Aug 2010 21:41:31 +0000 |
| Subject: | Re: Namespace separator constant | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49282@lists.php.net to get a copy of this message | ||
Hello Christian
2010/8/10 Christian Kaps <christian.kaps@mohiva.com>:
> Hi,
>
> is there any reason why no namespace separator constant exists in PHP. I
> have many cases where I concatenate strings to a namespace. This ends up
> with many class constants like const NS_SEPARATOR = '\\'. A default PHP
> constant would be a better way to handle such cases
There is no reason to add such a constant for language level features,
if you REALLY such a feature then a define() call is all you need:
define('NS_CONSTANT', '\\');
I do not see a reason to add such a thing just because the separator
is a backslash which most people belive is a escape character in all
cases outside string interpolation.
--
regards,
Kalle Sommer Nielsen
kalle@php.net