PHP 类名中的点 [英] Dot in a PHP Class Name
本文介绍了PHP 类名中的点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 PHP 中使用名为
Is it illegal in PHP to have a class named
class foo.bar{
}
我收到错误,提示 {
预期而不是 .
是否有解决此问题的配置,还是该错误在谈论其他内容?
I am getting errors that say {
expected instead of .
is there a configuration work around to this or is the error talking abouts something else?
推荐答案
来自 手册:
有效的类名以字母或下划线开头,后跟任意数量的字母、数字或下划线.
A valid class name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
点无效,您无法更改任何设置以使其有效.
Dots are not valid and you can't change any settings to make them valid.
这篇关于PHP 类名中的点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文