[nycphp-talk] what do you call this? $dollar $dollar.

Hans Zaunere zaunere at
Wed Jun 19 16:12:45 EDT 2002

--- Petr Pomorov <petr at> wrote:
> Hi all, what do you call this in English?
> $dollar=1
> $dollar.=2
> $dollar.=3
> Best regards.

Bad programming?

Oh, not to beat a dead horse, but that really should be:

$dollar = '1';
$dollar .= '2';
$dollar .= '3';

where $dollar will now be '123'

Since the concatenating assignment operator
( is for
strings, and makes no sense with ints.  For ints:

$dollar = 1;
$dollar += 2;
$dollar += 3;

and now $dollar is 6 by way of the combined operators.

Also note the important distinction about references in the last
paragraph (as noted in my references presentation, when using .= made
PHP loop endlessly).


Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

More information about the talk mailing list