|  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
Status: Closed Package: Arrays related
PHP Version: 4.3.1-dev OS: Linux, Windows
Private report: No CVE-ID:
 [2003-02-06 03:43 UTC] audrius at vpu dot lt
$last = array_shift ($m);
$m[]='c';//or array_push ($m,'c');

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.


Add a Patch

Pull Requests

Add a Pull Request


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

 [2003-02-06 09:29 UTC]
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
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the 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).

 [2003-03-05 12:32 UTC]
[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-2015 The PHP Group
All rights reserved.
Last updated: Fri Oct 09 17:01:29 2015 UTC