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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 19:01:35 2025 UTC