ID: 31513 Updated by: [EMAIL PROTECTED] Reported By: dan at yes dot lt -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: any PHP Version: 5.0.3 New Comment:
You can never rely on this behavior, not in any language that I know about. Do not use the post/pre inc operation in assignments like this. Previous Comments: ------------------------------------------------------------------------ [2005-01-12 11:58:30] dan at yes dot lt Description: ------------ Arithmetic expression execution returns unexpected results with ++ or -- operators. Reproduce code: --------------- $a = 10; $c = $a++ + ++$a; echo "$c\n"; $a = 10; $c = ++$a + $a++; echo "$c\n"; Expected result: ---------------- 22 22 Actual result: -------------- 22 23 <- ?? Why ?? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31513&edit=1
