php.net |  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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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';
$i++;
echo "i = $i\ntype = " . gettype($i) . "\n";

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


Reference Case:

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

Output:
    i=-2
    type=integer

Patches

Pull Requests

History

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