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
This commit is contained in:
Christoph Michael Becker 2017-08-25 13:43:56 +00:00
parent b2c1d554c7
commit 38c4ad6a3d

View file

@ -99,10 +99,17 @@ var_dump(current($arr)); // array(0) { }
&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 and the result of calling
<function>current</function> on an empty array
are 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>current</function> and properly check if the value
is really an element of the array, the <function>key</function>
of the <function>current</function> element should be checked to be strictly
different from <type>null</type>.
</simpara>
</note>
</refsect1>