reference/spl/functions/iterator-apply.xml
60809ebcf7d0c261b2f00e093e4fab70326ffc7b
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="function.iterator-apply" xmlns="http://docbook.org/ns/docbook">
5
4
<refnamediv>
6
5
<refname>iterator_apply</refname>
...
...
@@ -12,8 +11,8 @@
12
11
<methodsynopsis>
13
12
<type>int</type><methodname>iterator_apply</methodname>
14
13
<methodparam><type>Traversable</type><parameter>iterator</parameter></methodparam>
15
-
<methodparam><type>callable</type><parameter>function</parameter></methodparam>
16
-
<methodparam choice="opt"><type>array</type><parameter>args</parameter></methodparam>
14
+
<methodparam><type>callable</type><parameter>callback</parameter></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>array</type><type>null</type></type><parameter>args</parameter><initializer>&null;</initializer></methodparam>
17
16
</methodsynopsis>
18
17
<para>
19
18
Calls a function for every element in an iterator.
...
...
@@ -28,15 +27,18 @@
28
27
<term><parameter>iterator</parameter></term>
29
28
<listitem>
30
29
<para>
31
-
The class to iterate over.
30
+
The iterator object to iterate over.
32
31
</para>
33
32
</listitem>
34
33
</varlistentry>
35
34
<varlistentry>
36
-
<term><parameter>function</parameter></term>
35
+
<term><parameter>callback</parameter></term>
37
36
<listitem>
38
37
<para>
39
38
The callback function to call on every element.
39
+
This function only receives the given <parameter>args</parameter>, so it
40
+
is nullary by default. If <literal>count($args) === 3</literal>, for
41
+
instance, the callback function is ternary.
40
42
<note>
41
43
<simpara>
42
44
The function must return &true; in order to
...
...
@@ -50,7 +52,9 @@
50
52
<term><parameter>args</parameter></term>
51
53
<listitem>
52
54
<para>
53
-
Arguments to pass to the callback function.
55
+
An <type>array</type> of arguments; each element of
56
+
<parameter>args</parameter> is passed to the callback
57
+
<parameter>callback</parameter> as separate argument.
54
58
</para>
55
59
</listitem>
56
60
</varlistentry>
...
...
@@ -143,7 +147,6 @@ CHERRIES
143
147
</refsect1>
144
148

145
149
</refentry>
146
-

147
150
<!-- Keep this comment at the end of the file
148
151
Local variables:
149
152
mode: sgml
150
153