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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gregorschg at web dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 07:01:28 2025 UTC