note 104474 added to function.array-key-exists
| From: | Anonymous at osu1 dot php dot net | Date: | Thu, 16 Jun 2011 20:07:29 +0000 |
| Subject: | note 104474 added to function.array-key-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-180629@lists.php.net to get a copy of this message | ||
I just want to note that array_key_exists() can be extremely slow for large (>200 keys) arrays.
Use isset($array($key)) instead! My program ran in 3 minutes instead of 2 hours after switching to
isset()!
----
Server IP: 69.147.83.197
Probable Submitter: 129.173.214.92
----
Manual Page -- http://www.php.net/manual/en/function.array-key-exists.php
Edit -- https://master.php.net/note/edit/104474
Del: integrated -- https://master.php.net/note/delete/104474/integrated
Del: useless -- https://master.php.net/note/delete/104474/useless
Del: bad code -- https://master.php.net/note/delete/104474/bad+code
Del: spam -- https://master.php.net/note/delete/104474/spam
Del: non-english -- https://master.php.net/note/delete/104474/non-english
Del: in docs -- https://master.php.net/note/delete/104474/in+docs
Del: other reasons-- https://master.php.net/note/delete/104474
Reject -- https://master.php.net/note/reject/104474
Search -- https://master.php.net/manage/user-notes.php