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.
Greetings,
Christian
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.
It is already constant (i.e. it's always a backslash). What do you
need a constant for? It's not system nor configuration dependent.
--
Daniel Egeberg
On Tue, Aug 10, 2010 at 9:59 PM, Daniel Egeberg daniel.egeberg@gmail.comwrote:
On Tue, Aug 10, 2010 at 21:56, Christian Kaps christian.kaps@mohiva.com
wrote: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.It is already constant (i.e. it's always a backslash). What do you
need a constant for? It's not system nor configuration dependent.--
Daniel Egeberg
like DIRECTORY_SEPARATOR
I guess
Tyrael
like
DIRECTORY_SEPARATOR
I guessTyrael
but, DIRECTORY_SEPARATOR
is system dependent. The namespace separator is
not. It is is always .
--
Brian.
Am 10.08.2010 22:07, schrieb Brian Moon:
like
DIRECTORY_SEPARATOR
I guessTyrael
but,
DIRECTORY_SEPARATOR
is system dependent. The namespace separator
is not. It is is always .
OK. This is clear.
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