> > > $variables shoud be concatenated with '. instead of using "$var strng".
> > -1. I prefer "$var string".
> 
> $var." string" is less ambigious. Actually it should be $var.' string' as
> "$var string" and '$var string' behave differently $var.' string' and $var."
> string" work the same.

-1 for worrying about this, both the following are fine with me:

  $var . ' string'
  "$var string"

On a related note, we should discuss arrays in strings too:

 "a $arr[foo] b"
 "a {$arr['foo']} b"
 'a ' . $arr['foo'] . ' b';

I prefer the first but it will/may make some people feel not surrounding
keys with quotes is okay, it's not unless in a string otherwise
eventually a E_NOTICE error is created.  Concatenation seems appropriate
here.

Regards,
Philip Olson


Reply via email to