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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 06:01:32 2024 UTC