From da772b264919f984b6d2fc3920ec93f6b713be0f Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker Date: Fri, 25 Aug 2017 13:44:44 +0000 Subject: [PATCH] Update note on how to check the values of arrays which may contain false, since each will soon be deprecated. -- Provided by anonymous 84645 (petcu.stephan@gmail.com) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342935 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/array/functions/next.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/reference/array/functions/next.xml b/reference/array/functions/next.xml index 7463ba0074..51c7430ebd 100644 --- a/reference/array/functions/next.xml +++ b/reference/array/functions/next.xml @@ -70,10 +70,14 @@ $mode = end($transport); // $mode = 'plane'; &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 is indistinguishable from a boolean &false; element. + To properly traverse an array which may contain &false; elements, see the + foreach function. + + + To still use next and properly check if the end of the array + has been reached, the key of the next + element should be checked to be strictly different from null.