请问下面这段代码是什么意思?是直接取对象的方法嘛?
throw new exception\runtimeexception('config is read only')
是不是所有的php都可以通过\直接取对象的方法,哪个版本改进的,谁能提供下相关资料
回复内容: 请问下面这段代码是什么意思?是直接取对象的方法嘛?
throw new exception\runtimeexception('config is read only')
是不是所有的php都可以通过\直接取对象的方法,哪个版本改进的,谁能提供下相关资料
这个就是php的namespace特性,便于更好的组织代码结构,防止命名冲突,从5.3.0开始支持的,详见官方文档:
http://www.php.net/manual/en/language...
具体你的代码,调用的类结构如下:
namespace exception;class runtimeexception extends exception{ function xxx(){...}}
