svn: /phpdoc/en/trunk/reference/array/functions/ count.xml

From: Date: Mon, 12 Nov 2012 22:34:04 +0000
Subject: svn: /phpdoc/en/trunk/reference/array/functions/ count.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-10700@lists.php.net to get a copy of this message
salathe Mon, 12 Nov 2012 22:34:04 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=328332 Log: count() does in fact discover recursion and issues an E_WARNING in response... but it will probably return a much higher number than it should. (doc #63406) -- Provided by anonymous #22227 (mail+php@requinix.net) Bugs: https://bugs.php.net/63406 (Open) Count *does* detect infinite recursion https://bugs.php.net/22227 (Closed) printf() field limiters broke between 4.2.3 and 4.3.0 Changed paths: U phpdoc/en/trunk/reference/array/functions/count.xml Modified: phpdoc/en/trunk/reference/array/functions/count.xml =================================================================== --- phpdoc/en/trunk/reference/array/functions/count.xml 2012-11-12 22:33:52 UTC (rev 328331) +++ phpdoc/en/trunk/reference/array/functions/count.xml 2012-11-12 22:34:04 UTC (rev 328332) @@ -49,8 +49,15 @@ <constant>COUNT_RECURSIVE</constant> (or 1), <function>count</function> will recursively count the array. This is particularly useful for counting all the elements of a multidimensional array. - <function>count</function> does not detect infinite recursion. </para> + <caution> + <para> + <function>count</function> can detect recursion to avoid an infinite + loop, but will emit an <constant>E_WARNING</constant> every time it + does (in case the array contains itself more than once) and return a + count higher than may be expected. + </para> + </caution> </listitem> </varlistentry> </variablelist>

« previous php.doc.cvs (#10700) next »