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.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to