A php namespace called default

后端 未结 2 470
[愿得一人]
[愿得一人] 2021-01-18 18:14

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

相关标签:
2条回答
  • 2021-01-18 18:31

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

    0 讨论(0)
  • 2021-01-18 18:33

    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

    0 讨论(0)
提交回复
热议问题