PHP Sadness

Cannot do static concatenation in member variable definition

Static (that is, it will always return the same value) expression definitions of member variables is not only disallowed in PHP, it is a syntax error:

class Example {
  private $var = "a" . "b";
}

Parse error: syntax error, unexpected '.', expecting ',' or ';' in...

This would be trivial to handle at the compilation step, make developers' lives easier, and allow for cleaner code, even if the desired value only uses other compile-time expressions like __CLASS__ or __FILE__.

Turns out this makes other developers sad, too.

Significance: Implications for Internals

The mere presence of this issue tends to imply some fatal flaw or unnecessary complexity at the most basic levels of the language. For example, an overly complex parser might be trying to compensate for missing functionality in the interpreter by incorrectly (and misleadingly) validating code at the syntax level, or messages without details could indicate that the internal design prohibits access to values where they should be reachable in a sane implementation.

Significance: Missing Features

Language features make developers' lives easier. Often, language features are not complex for the language designers to implement (barring unnecessary complications in the internals), but can save developers hours of time. Missing language features are disrespectful to developers and encourage dirty hacks, "clever" solutions, and kludgy workarounds to achieve the desired functionality.