note 130541 added to function.array-find

From: Date: Sun, 09 Nov 2025 12:03:52 +0000
Subject: note 130541 added to function.array-find
Groups: php.notes 
Request: Send a blank email to php-notes+get-222415@lists.php.net to get a copy of this message
Note that if null satisfies the callback then there is no way to tell if null was returned because it was found in the array or if it was because nothing satisfying the callback was found. In this case, it'll be more robust to use array_find_key; null can't be a key, so if that's what you get it must be because the search failed to find a match. Obviously, you'd then use the array key to look up the corresponding value in the array. ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 122.57.27.239) ---- Manual Page -- https://php.net/manual/en/function.array-find.php Edit -- https://main.php.net/note/edit/130541 Del: integrated -- https://main.php.net/note/delete/130541/integrated Del: useless -- https://main.php.net/note/delete/130541/useless Del: bad code -- https://main.php.net/note/delete/130541/bad+code Del: spam -- https://main.php.net/note/delete/130541/spam Del: non-english -- https://main.php.net/note/delete/130541/non-english Del: in docs -- https://main.php.net/note/delete/130541/in+docs Del: other reasons-- https://main.php.net/note/delete/130541 Reject -- https://main.php.net/note/reject/130541 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#222415) next »