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