I'm not sure I have your point of view ... PHP constants are not like macro preprocessor C. You cannot create a macro and replace it with an operator - it just won't work:
<?php define('ADD', '+'); echo (3 ADD 5);
Even if it worked, what is the purpose? Hiding the language syntax so that it looks like another language that you are more familiar with is a waste of time, not to mention the fact that it’s more difficult for other coders to work on a project. If you think the X language looks cooler, well, it's just X code, not PHP :)
Update
Using a namespace delimiter in places where a string is required (such as autoloaders and callbacks) creates small difficulties when using single quotes, since the only places to escape are right before the quote or other backslash can be written as there is:
$callback = 'Foo\Bar';
All other options look like unnecessary complexity to me:
$callback = "Foo\\Bar"; $callback = 'Foo' . NAMESPACE_SEPARATOR . 'Bar'; $callback = "Foo{$namespace_separator}Bar";
Álvaro González
source share