views:

49

answers:

2
<?php
namespace default

gives me an unexpecected T_DEFAULT, is there any way of working around this? Can I escape the reserved word somehow?

My system uses the name of the current module in my site for the namespace so it would be nice to be able to use any string as a namespace.

+2  A: 

You can't use reserved words like default for namespaces in PHP - you'll have to find a workaround (_default, default_, default1 etc.?).

Skilldrick
A: 

As @drick says you cant use a php reserved word for your purpose.

It has its own meaning. For more info on namespaces you can have a look here FYI default is a reserved word used in switch case more info here

nepsdotin
I know default is reserved word, i mentioned that in my OP. I just wondered if there was a way of escaping it
michael