[nycphp-talk] what do you call this? $dollar $dollar.
zaunere at yahoo.com
Wed Jun 19 16:12:45 EDT 2002
--- Petr Pomorov <petr at linux.ru> wrote:
> Hi all, what do you call this in English?
> Best regards.
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
(http://www.php.net/manual/en/language.operators.string.php) 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