This question got me thinking about bare strings.
When PHP sees a string that\'s not enclosed in quotes, it first checks to see if it\'s a constant. If not, it just
The only time you would use a bare string as a key is if it's been previously used in define() for a constant.
This doesn't probably count as legitimate, but my friend's tweetable proof-of-concept MVC framework, TweetMVC eschews quotes in a few spots to squeeze a few more characters in, e.g.:
foreach(c('mod')as$f)require"t/$f.php";@list($c,$m,$a)=explode('/',@$_GET[r],3);$c=$c?:c('dc');$o=(@include"c/$c.php")?@new$c($m,$a):e(1)
Nope, I can not see a single instance where it would make sense, and it always is dangerous. Using strings without quotes should absolutely be reserved to address constants. I don't understand how the inventors of PHP could decide to introduce this ridiculous behaviour at all - it makes the proper use of constants almost impossible (because if you try to access a constant that has not been defined, PHP will silently and stupidly generate a string) without giving any benefit.