Bug #54635 [Csd->Bgs]: Decrementing character variables does not work as expected
| From: | dtajchreber@php.net | Date: | Fri, 29 Apr 2011 15:34:51 +0000 |
| Subject: | Bug #54635 [Csd->Bgs]: Decrementing character variables does not work as expected | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-160454@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54635&edit=1
ID: 54635
Updated by: dtajchreber@php.net
Reported by: reto dot kohli at comvation dot com
Summary: Decrementing character variables does not work as
expected
-Status: Closed
+Status: Bogus
Type: Bug
Package: Strings related
Operating System: win32
PHP Version: Irrelevant
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2011-04-29 15:59:45] reto dot kohli at comvation dot com
It is documented... :(
------------------------------------------------------------------------
[2011-04-29 15:57:28] reto dot kohli at comvation dot com
Description:
------------
In the documentation
(http://www.php.net/manual/en/language.operators.increment.php),
"Example #1 Arithmetic Operations on Character Variables" shows how
strings can be incremented.
You would expect this to work the opposite way, too -- however, it
doesn't.
See the modified code from Example #1 attached.
Test script:
---------------
$i = 'W';
for ($n=0; $n<6; $n++) {
echo --$i . "\n";
}
Expected result:
----------------
V
U
T
S
R
Q
Actual result:
--------------
W
W
W
W
W
W
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54635&edit=1