ID:               40860
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tjerk dot meesters at muvee dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         *General Issues
 Operating System: Linux 2.6
 PHP Version:      5.2.1
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php




Previous Comments:
------------------------------------------------------------------------

[2007-03-20 07:30:07] tjerk dot meesters at muvee dot com

Description:
------------
Applying the increment operator (++) on a variable (containing a
number) ending with a newline character doesn't change the variable.

However, applying += 1 to the same variable does result in the right
behaviour.

Reproduce code:
---------------
function showsucc($x)
{
  // using increment operator
  $tmp = $x; $tmp++;
  echo "successor of $x = ",$tmp,"\n";
  // using plus operator
  $tmp = $x; $tmp += 1;
  echo "result of $x + 1 = ",$tmp,"\n";
}

showsucc("123\n");
showsucc("123");


Expected result:
----------------
successor of 123
 = 124
result of 123
 + 1 = 124
successor of 123 = 124
result of 123 +1 = 124

Actual result:
--------------
successor of 123
 = 123 <---- difference is here

result of 123
 + 1 = 124
successor of 123 = 124
result of 123 + 1 = 124



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40860&edit=1

Reply via email to