php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11773 String ++ error
Submitted: 2001-06-28 06:44 UTC Modified: 2001-07-15 12:53 UTC
From: support at obantec dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.6 OS: RH6.2 Linux
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: support at obantec dot net
New email:
PHP Version: OS:

 

 [2001-06-28 06:44 UTC] support at obantec dot net
In 4.0.5 if you use $string++ and then fetch $string[x] it works.
In 4.0.6 if you do same it returns null!
see http://www.obanworld.co.uk/stringerror.php 4.0.4pl1 working
see http://www.obantec.com/stringerror.php for 4.0.5 working
see http://www.obantec.net/stringerror.php for 4.0.6 failing

Source is http://www.obantec.com/stringerror.txt

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-15 12:53 UTC] zeev@php.net
This was an intentional change.  PHP now autoconverts numeric strings to numbers in the ++ operator, like it does in the other numeric operators.
$s = "12345";
$s++;  /* $s gets autoconvered to an integer, $s is from now on meaningless */

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu May 08 00:01:29 2025 UTC