|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12201 Order in array function
Submitted: 2001-07-17 07:01 UTC Modified: 2001-10-22 12:48 UTC
From: xinkun at soi dot city dot ac dot uk Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.0.6 OS: UNIX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: xinkun at soi dot city dot ac dot uk
New email:
PHP Version: OS:


 [2001-07-17 07:01 UTC] xinkun at soi dot city dot ac dot uk
array_diff and array_intersect (maybe also other array functions) change the original order from compared arrays,
could you keep the initial order?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-14 19:33 UTC]
Sample script?
 [2001-10-21 01:45 UTC]
Please add a short example script which demonstrates the problem.

 [2001-10-22 12:48 UTC]
User added example:
  array1={a, b, c ,d}, array2={c, f, b}

  if do array_intersect(array1, array2), return b,c
  if do array_intersect(array2, array1), return c,b


So it keeps the original order of the first array mentioned.
Bug a bug, as this is exaclty what should happen.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 19:03:38 2021 UTC