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?
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?
Dots are not allowed.
The class name can be any valid label which is a not a PHP reserved word. A valid class name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*.
Shamelesse ripped from here.
The dot
.
is the string-concatenation operator, thus its not allowed anywhere in an identifier.From the manual:
Dots are not valid and you can't change any settings to make them valid.
PHP class names can't have periods in them. There's no way around this.
A dot isnt allowed, as documented: http://php.net/manual/en/language.oop5.basic.php
Dots are not allowed in class names. Period.