svn: /phpdoc/en/trunk/reference/simplexml/ simplexmlelement/children.xml simplexmlelement/count.xml versions.xml
| From: | Daniel Egeberg | Date: | Wed, 03 Mar 2010 14:13:09 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/simplexml/ simplexmlelement/children.xml simplexmlelement/count.xml versions.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6165@lists.php.net to get a copy of this message | ||
degeberg Wed, 03 Mar 2010 14:13:09 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=295784
Log:
Fixed #50864 (SimpleXMLElement::count does not exist)
Bug: http://bugs.php.net/50864 (Open)
SimpleXMLElement::count does not exist
Changed paths:
U phpdoc/en/trunk/reference/simplexml/simplexmlelement/children.xml
A phpdoc/en/trunk/reference/simplexml/simplexmlelement/count.xml
U phpdoc/en/trunk/reference/simplexml/versions.xml
Modified: phpdoc/en/trunk/reference/simplexml/simplexmlelement/children.xml
===================================================================
--- phpdoc/en/trunk/reference/simplexml/simplexmlelement/children.xml 2010-03-03 12:43:00 UTC (rev
295783)
+++ phpdoc/en/trunk/reference/simplexml/simplexmlelement/children.xml 2010-03-03 14:13:09 UTC (rev
295784)
@@ -175,7 +175,8 @@
<methodname>SimpleXMLElement::children</methodname> returns a node
object no matter if the current node has children or not. Use
<function>count</function> on the return value to see if there are any
- children.
+ children. As of PHP 5.3.0, <methodname>SimpleXMLElement::count</methodname>
+ may be used instead.
</simpara>
</refsect1>
@@ -183,6 +184,7 @@
&reftitle.seealso;
<para>
<simplelist>
+ <member><methodname>SimpleXMLElement::count</methodname></member>
<member><function>count</function></member>
</simplelist>
</para>
Added: phpdoc/en/trunk/reference/simplexml/simplexmlelement/count.xml
===================================================================
--- phpdoc/en/trunk/reference/simplexml/simplexmlelement/count.xml (rev 0)
+++ phpdoc/en/trunk/reference/simplexml/simplexmlelement/count.xml 2010-03-03 14:13:09 UTC (rev
295784)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+
+<refentry xml:id="simplexmlelement.count" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>SimpleXMLElement::count</refname>
+ <refpurpose>Counts the children of an element</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <type>integer</type><methodname>SimpleXMLElement::count</methodname>
+ <void />
+ </methodsynopsis>
+ <para>
+ This method counts the number of children of an element.
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns the number of elements of an element.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Counting the number of children</title>
+ <programlisting role="php">
+<![CDATA[
+$xml = <<<EOF
+<people>
+ <person name="Person 1">
+ <child/>
+ <child/>
+ <child/>
+ </person>
+ <person name="Person 2">
+ <child/>
+ <child/>
+ <child/>
+ <child/>
+ <child/>
+ </person>
+</people>
+EOF;
+
+$elem = new SimpleXMLElement($xml);
+
+foreach ($elem as $person) {
+ printf("%s has got %d children.\n", $person['name'], $person->count());
+}
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
+Person 1 has got 3 children.
+Person 2 has got 5 children.
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><methodname>SimpleXMLElement::children</methodname></member>
+ </simplelist>
+ </para>
+ </refsect1>
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"~/.phpdoc/manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
+
Property changes on: phpdoc/en/trunk/reference/simplexml/simplexmlelement/count.xml
___________________________________________________________________
Added: svn:keywords
+ Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
Modified: phpdoc/en/trunk/reference/simplexml/versions.xml
===================================================================
--- phpdoc/en/trunk/reference/simplexml/versions.xml 2010-03-03 12:43:00 UTC (rev 295783)
+++ phpdoc/en/trunk/reference/simplexml/versions.xml 2010-03-03 14:13:09 UTC (rev 295784)
@@ -14,6 +14,7 @@
<function name='simplexmlelement::asxml' from='PHP 5 >= 5.0.1'/>
<function name='simplexmlelement::attributes' from='PHP 5 >=
5.0.1'/>
<function name='simplexmlelement::children' from='PHP 5 >=
5.0.1'/>
+ <function name='simplexmlelement::count' from='PHP 5 >= 5.3.0'/>
<function name='simplexmlelement::getdocnamespaces' from='PHP 5 >=
5.1.2'/>
<function name='simplexmlelement::getname' from='PHP 5 >=
5.1.3'/>
<function name='simplexmlelement::getnamespaces' from='PHP 5 >=
5.1.2'/>
@@ -49,4 +50,4 @@
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
--->
\ No newline at end of file
+-->