Don't mix + and ++ (doc bug #53786)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@308186 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2011-02-10 12:42:46 +00:00
parent 693563124f
commit a7ef3cd8b1

View file

@ -221,6 +221,10 @@ $a = true ? 0 : true ? 1 : 2; // (true ? 0 : true) ? 1 : 2 = 2
$a = 1;
$b = 2;
$a = $b += 3; // $a = ($b += 3) -> $a = 5, $b = 5
// mixing ++ and + produces undefined behavior
$a = 1;
echo ++$a + $a++; // may print 4 or 5
?>
]]>
</programlisting>