php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31425 $string++ / $string-- ?
Submitted: 2005-01-06 06:35 UTC Modified: 2005-01-10 14:43 UTC
From: gregorschg at web dot de Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.0.3 OS: win xp
Private report: No CVE-ID: None
 [2005-01-06 06:35 UTC] gregorschg at web dot de
Description:
------------
I have a problem to decreasing strings.
Increasing a string works fine.



Reproduce code:
---------------
$letter = "C";
$letter--;
echo "$letter";

Expected result:
----------------
output of $str >> "B"


Actual result:
--------------
output of $str >> "C"


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-08 20:17 UTC] gregorschg at web dot de
sorry, I mean output of $letter is "C" and expected output of $letter is "B".
 [2005-01-10 14:43 UTC] sniper@php.net
RTFM:
http://www.php.net/manual/en/language.operators.increment.php

"Note that character variables can be incremented but not decremented."


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 05:01:28 2024 UTC