简体   繁体   中英

A php namespace called default

<?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.

你不能在PHP中使用default保留字作为命名空间 - 你必须找到一个解决方法( _defaultdefault_default1等?)。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM