I don't see your point, Sebastian. > And > > | $studipNamedVariable = Databases::Mysql; > | // ... much code > | database_select($stupidNamedVariable, $sql); > > is better? The problem here seems to be more the developer, that > avoids the use of constants, then less the missing enums. You can obviously do weird things, as with in any feature. In this case you bring up, I see little sense in passing enums in variables, unless that comes itself from a parameter for that function, or comes from an external source, like a configuration data.
> If you use a constant like > > | Databases::Mysql = 1024; > > the call > > | database_select(Database::IDontExists, $sql); > > will fail too. Other examples, that supports type hints, can be found > in other mails around here. Yes. With a parser error as IDontExists doesn't belong to Database enum. How does it relate with assigning 1024 to Databases::Mysql ? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php