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
This commit is contained in:
Christoph Michael Becker 2017-08-25 13:44:44 +00:00
parent 2030feeb3f
commit da772b2649

View file

@ -70,10 +70,14 @@ $mode = end($transport); // $mode = 'plane';
&reftitle.notes;
<note>
<simpara>
You won't be able to distinguish the end of an array from a
<type>boolean</type> &false; element. To properly traverse an array
which may contain &false; elements, see the <function>each</function>
function.
The end of an array is indistinguishable from a <type>boolean</type> &false; element.
To properly traverse an array which may contain &false; elements, see the
<function>foreach</function> function.
</simpara>
<simpara>
To still use <function>next</function> and properly check if the end of the array
has been reached, the <function>key</function> of the <function>next</function>
element should be checked to be strictly different from <type>null</type>.
</simpara>
</note>
</refsect1>