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
 [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: Wed Apr 24 14:01:30 2024 UTC