note 39419 added to function.array-search
| From: | dcsobodaatoaklanddotedu at rn2 dot php dot net | Date: | Wed, 28 Jan 2004 06:13:37 +0000 |
| Subject: | note 39419 added to function.array-search | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64294@lists.php.net to get a copy of this message | ||
I've noticed problems with array_search() when it's handling extremely large arrays.
In one example, I had a 2000 slot array with a 128 char string in each slot, and was searching for a
128 char string within the array.
It regularly returned the wrong key. I even had it print the search string, along with the found key
in the array, as a test, and it would print obvious different strings.
The problem was alleviated when I ran gzcompress() on each array slot (and on my search string,
obviously). In this case, no strings were longer than 67 bytes. It performed far faster and had no
accuracy problems.
----
Manual Page -- http://www.php.net/manual/en/function.array-search.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39419
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39419&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39419&report=yes
Search -- http://master.php.net/manage/user-notes.php