From 38c4ad6a3deff9342dc0821ffd279d56679c5b1d Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker Date: Fri, 25 Aug 2017 13:43:56 +0000 Subject: [PATCH] Update notes: removed reference to `each` (deprecated as of 7.2) and updated with alternatives. -- Provided by anonymous 84645 (petcu.stephan@gmail.com) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342933 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/array/functions/current.xml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/reference/array/functions/current.xml b/reference/array/functions/current.xml index 0b145a86ca..60a34a2f5e 100644 --- a/reference/array/functions/current.xml +++ b/reference/array/functions/current.xml @@ -99,10 +99,17 @@ var_dump(current($arr)); // array(0) { } &reftitle.notes; - You won't be able to distinguish the end of an array from a - boolean &false; element. To properly traverse an array - which may contain &false; elements, see the each - function. + The end of an array and the result of calling + current on an empty array + are indistinguishable from a boolean &false; element. + To properly traverse an array which may contain &false; elements, see the + foreach function. + + + To still use current and properly check if the value + is really an element of the array, the key + of the current element should be checked to be strictly + different from null.