|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2012-01-27 03:52 UTC] carloschilazo at gmail dot com
  [2012-03-25 17:27 UTC] phristen at yahoo dot com
  [2012-03-25 17:31 UTC] phristen at yahoo dot com
  [2017-11-26 16:31 UTC] christoph at burschka dot de
 | |||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 03:00:01 2025 UTC | 
Description: ------------ The trivial test script below runs longer than the extpected "instant" execution (lot longer). This is because the algorithm walks the first argument and looks up the key in every other array supplied as an argument. Instead it should walk the shortest array given, and look up the keys in every other array. Maybe this issue or similar ones also apply to other array functions, which perform set operations, but I have not checked the code of them. Of course the optimization could be done in userland, but that feels not right. Test script: --------------- $arr = array_fill(0, 1000000, '...'); $i = 1000; while($i--) { array_intersect_key($arr, array()); }