Re: PHP String convention
| From: | Nathan Rixham | Date: | Wed, 04 Nov 2009 14:50:49 +0000 |
| Subject: | Re: PHP String convention | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299611@lists.php.net to get a copy of this message | ||
Nick Cooper wrote:
Hi, I was just wondering what the difference/advantage of these two methods of writing a string are: 1) $string = "foo{$bar}"; 2) $string = 'foo'.$bar;1) breaks PHPUnit when used in classes (need to bug report that) 2) [concatenation] is faster (but you wouldn't notice) comes down to personal preference and what looks best in your (teams) IDE I guess; legibility (and possibly portability) is probably the primary concern.