[prev in list] [next in list] [prev in thread] [next in thread]
List: php-doc-cvs
Subject: [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/reference/array/functions/_reset.xml?=
From: Christoph_Michael_Becker <cmb () php ! net>
Date: 2017-08-25 13:45:28
Message-ID: svn-cmb-1503668728-342937-774405763 () svn ! php ! net
[Download RAW message or body]
cmb Fri, 25 Aug 2017 13:45:28 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=342937
Log:
Update return with return false problem.
Add note about how to deal with the above problem.
--
Provided by anonymous 84645 (petcu.stephan@gmail.com)
Changed paths:
U phpdoc/en/trunk/reference/array/functions/reset.xml
Modified: phpdoc/en/trunk/reference/array/functions/reset.xml
===================================================================
--- phpdoc/en/trunk/reference/array/functions/reset.xml 2017-08-25 13:45:04 UTC (rev 342936)
+++ phpdoc/en/trunk/reference/array/functions/reset.xml 2017-08-25 13:45:28 UTC (rev 342937)
@@ -38,6 +38,7 @@
Returns the value of the first array element, or &false; if the array is
empty.
</para>
+ &return.falseproblem;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
@@ -68,6 +69,19 @@
</example>
</para>
</refsect1>
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <note>
+ <simpara>
+ The return value for an empty array is indistinguishable from
+ the return value in case of an array which has a <type>boolean</type> &false;
+ first element. To properly check the value of the first element of an array
+ which may contain &false; elements, first check the <function>count</function>
+ of the array, or check that <function>key</function> is strictly different from
+ <type>null</type>, after calling <function>reset</function>.
+ </simpara>
+ </note>
+ </refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
--
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic