Is there any legitimate use for bare strings in PHP?

前端 未结 3 548
野性不改
野性不改 2020-12-04 00:51

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

3条回答
  •  自闭症患者
    2020-12-04 01:04

    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)
    

提交回复
热议问题