Re: PHP String convention

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux