note 91378 deleted from language.operators.assignment by mazzanet
| From: | mazzanet@php.net | Date: | Thu, 20 Aug 2009 14:12:17 +0000 |
| Subject: | note 91378 deleted from language.operators.assignment by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159698@lists.php.net to get a copy of this message | ||
Note Submitter: headden at karelia dot ru
----
Pay attention that combined operators affect not only variable value, but also its type:
<?php
$a = "45";
var_dump($a); echo "<br/>";
$a += 5;
var_dump($a); echo "<br/>";
echo "<br/>";
$b = 56;
var_dump($b); echo "<br/>";
$b .= "qweasd";
var_dump($b); echo "<br/>";
?>
Outputs:
string(2) "45"
int(50)
int(56)
string(8) "56qweasd"