Reserved words are case-insensitive.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php5 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: php5
Ubuntu 9.04
PHP 5.2.6-3ubuntu4.1
At the least, this is a documentation bug; I consider the behavior undesirable, so it's also a feature request. I was told to report bugs to Ubuntu rather than PHP; if this is incorrect, I'll take it upstream myself.
I learned the below function name in other languages where it's allowed, although I'm not certain whether this is because keywords are case-sensitive or because foreach isn't a keyword there.
function forEach(){
}
I expect this to be valid, but PHP says otherwise:
Parse error: syntax error, unexpected T_FOREACH, expecting T_STRING
The manual doesn't mention this that I can find ( http://
From http:// us2.php. net/manual/ en/functions. user-defined. php
Note: Function names are case-insensitive, though it is usually good form to call functions as they appear in their declaration.