I\'m trying to figure out why a ternary operator inside of a class will not parse. I think an example is the clearest way to show this.
This works fine:
A class property must be a constant expression.
This declaration may include an initialization, but this initialization must be a constant value--that is, it must be able to be evaluated at compile time and must not depend on run-time information in order to be evaluated.
http://www.php.net/manual/en/language.oop5.properties.php