svn: /phpdoc/en/trunk/reference/array/functions/ count.xml
| From: | Jakub Vrana | Date: | Tue, 14 Jun 2011 14:40:03 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/array/functions/ count.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-8267@lists.php.net to get a copy of this message | ||
vrana Tue, 14 Jun 2011 14:40:03 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=312153
Log:
Clarify count() with objects
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 2011-06-14 14:23:20 UTC (rev 312152)
+++ phpdoc/en/trunk/reference/array/functions/count.xml 2011-06-14 14:40:03 UTC (rev 312153)
@@ -3,7 +3,7 @@
<refentry xml:id="function.count" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>count</refname>
- <refpurpose>Count all elements in an array, or properties in an object</refpurpose>
+ <refpurpose>Count all elements in an array, or something in an object</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
@@ -13,14 +13,14 @@
<methodparam
choice="opt"><type>int</type><parameter>mode</parameter><initializer>COUNT_NORMAL</initializer></methodparam>
</methodsynopsis>
<para>
- Counts all elements in an array, or properties in an object.
+ Counts all elements in an array, or something in an object.
</para>
<para>
For objects, if you have
<link linkend="ref.spl">SPL</link> installed, you can hook into
<function>count</function> by implementing interface
<classname>Countable</classname>. The interface has exactly one method,
- <function>count</function>, which returns the return value for the
+ <methodname>Countable::count</methodname>, which returns the return value for the
<function>count</function> function.
</para>
<para>
@@ -37,7 +37,7 @@
<term><parameter>var</parameter></term>
<listitem>
<para>
- The array.
+ The array or the object.
</para>
</listitem>
</varlistentry>
@@ -59,11 +59,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
- Returns the number of elements in <parameter>var</parameter>, which is
- typically an <type>array</type>, since anything else will have one
- element.
- </para>
- <para>
+ Returns the number of elements in <parameter>var</parameter>.
If <parameter>var</parameter> is not an array or an object with
implemented <classname>Countable</classname> interface,
<literal>1</literal> will be returned.