|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3399 postfix increment operator (++) fails to cast string to integer
Submitted: 2000-02-03 22:44 UTC Modified: 2000-08-05 12:45 UTC
From: athompso at commerced dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.12 OS: Solaris
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.
Block user comment
Status: Assign to:
Bug Type:
From: athompso at commerced dot com
New email:
PHP Version: OS:


 [2000-02-03 22:44 UTC] athompso at commerced dot com
Test case:

$i = '-1';
echo "i = $i\ntype = " . gettype($i) . "\n";

    i=-2            (****questionable behaviour****)
    type=string            (****questionable behaviour****)

Reference Case:

$i = '-1';
echo "i = $i\ntype = " . gettype($i) . "\n";



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-02-06 06:28 UTC] sas at cvs dot php dot net
 [2000-08-05 05:50 UTC]
this still occures with latest php 3 & 4
 [2000-08-05 12:45 UTC]
This is Perl-style "smart increment". It is intended to be so.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 08 23:01:28 2023 UTC