0

I am having more trouble with namespacing when comes to the choice of words after this question I made earlier,

use \global\Conan as Cimmerian;

error message,

Parse error: syntax error, unexpected 'global' (T_GLOBAL), expecting identifier (T_STRING) in C:\wamp..

So that's no way you can name a directory as global in this situation?

Community
  • 1
  • 1
Run
  • 54,938
  • 169
  • 450
  • 748
  • 1
    A list for the meaning of the `T_xxx` tokens is available here: http://www.php.net/tokens - You also might find the error messages reference useful: [Reference - What does this error mean in PHP?](http://stackoverflow.com/q/12769982/367456) – hakre Mar 29 '13 at 09:37
  • Thanks for the links, hakre. – Run Mar 29 '13 at 14:50

1 Answers1

3

global is a reserved keyword in PHP, so cannot be used as an identifier.

See the List of Keywords in the PHP manual.

Although namespaces are not specifically mentioned on that page, they would cause the same problems as class names, in that the parser will not know what to do when it encounters the keyword - hence the error you are seeing.

IMSoP
  • 89,526
  • 13
  • 117
  • 169