mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
b2c1d554c7
commit
38c4ad6a3d
1 changed files with 11 additions and 4 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue