php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5331 ++ operator
Submitted: 2000-07-02 19:23 UTC Modified: 2000-07-02 23:21 UTC
From: zork at clan dot pl Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.0 OS: Linux (Slackware 7.0)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zork at clan dot pl
New email:
PHP Version: OS:

 

 [2000-07-02 19:23 UTC] zork at clan dot pl
Deep in my program I have such fragment:

list($newkey) = $db -> getrow();
$newkey++;
$data[$key] = $newkey;

And $newkey++ doesn't work!
If i change 

$newkey++;

to 

$newkey = $newkey + 1;

everything is fine - newkey gets incremented. But It doesn't with ++ operator.

Don't have time now to shrink the code to the smallest one that produce this behaviour and to upgarde to 4.0.1 - I will do it in one or two weeks.

regards
?ukasz Michalski.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-02 23:21 UTC] sterling at cvs dot php dot net
Re discussion on php-dev list:

Stringified number with a space is the problem, either typecast to int or eliminate the space.
 [2000-07-02 23:21 UTC] sterling at cvs dot php dot net
Closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 05:01:28 2024 UTC