php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22088 array_shift() and the last index of the array
Submitted: 2003-02-06 03:43 UTC Modified: 2003-03-05 12:32 UTC
From: audrius at vpu dot lt Assigned: sniper (profile)
Status: Closed Package: Arrays related
PHP Version: 4.3.1-dev OS: Linux, Windows
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: audrius at vpu dot lt
New email:
PHP Version: OS:

 

 [2003-02-06 03:43 UTC] audrius at vpu dot lt
$m=array('a','b');
$last = array_shift ($m);
$m[]='c';//or array_push ($m,'c');
print_r($m);

in 4.3.0 output is:
Array ( [0] => b [2] => c )

In previous php versions output was:
Array ( [0] => b [1] => c )

As yuo see, index for element 'c' differs.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-06 09:06 UTC] sniper@php.net
I'm checking this out..(verified with 4.3.1-dev)

 [2003-02-06 09:29 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.
 [2003-03-05 11:43 UTC] brian at n2solvingproblems dot com
This was reported as fixed on 6 Feb 2003, I just upgraded to 4.3.1 release version, which was release on 17 Feb 2003, and the bug still exists (Linux Redhat 7.2).

Brian
 [2003-03-05 12:32 UTC] sniper@php.net
[To: brian at n2solvingproblems dot com]

4.3.1 did not have ANY OTHER fixes but the security fix.
The fixes will be in next non-security release.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 16:01:29 2024 UTC