reference/array/functions/key.xml
0a192fcd9cc43c0007de795063b4494974058992
...
...
@@ -9,8 +9,8 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>mixed</type><methodname>key</methodname>
13
-
<methodparam><type>array</type><parameter>array</parameter></methodparam>
12
+
<type class="union"><type>int</type><type>string</type><type>null</type></type><methodname>key</methodname>
13
+
<methodparam><type class="union"><type>array</type><type>object</type></type><parameter>array</parameter></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
<function>key</function> returns the index element of the current array
...
...
@@ -42,31 +42,24 @@
42
42
empty, <function>key</function> returns &null;.
43
43
</para>
44
44
</refsect1>
45
+

45
46
<refsect1 role="changelog">
46
47
&reftitle.changelog;
47
-
<para>
48
-
<informaltable>
49
-
<tgroup cols="2">
50
-
<thead>
51
-
<row>
52
-
<entry>&Version;</entry>
53
-
<entry>&Description;</entry>
54
-
</row>
55
-
</thead>
56
-
<tbody>
57
-
<row>
58
-
<entry>7.0.0</entry>
59
-
<entry>
60
-
<parameter>array</parameter> is now always passed by value.
61
-
Prior to this version, it was passed by reference if possible,
62
-
and by value otherwise.
63
-
</entry>
64
-
</row>
65
-
</tbody>
66
-
</tgroup>
67
-
</informaltable>
68
-
</para>
48
+
<informaltable>
49
+
<tgroup cols="2">
50
+
<thead>
51
+
<row>
52
+
<entry>&Version;</entry>
53
+
<entry>&Description;</entry>
54
+
</row>
55
+
</thead>
56
+
<tbody>
57
+
&standard.changelog.calling-on-objects;
58
+
</tbody>
59
+
</tgroup>
60
+
</informaltable>
69
61
</refsect1>
62
+

70
63
<refsect1 role="examples">
71
64
&reftitle.examples;
72
65
<para>
...
...
@@ -86,7 +79,7 @@ $array = array(
86
79
// key where value equals "apple"
87
80
while ($fruit_name = current($array)) {
88
81
if ($fruit_name == 'apple') {
89
-
echo key($array).'<br />';
82
+
echo key($array), "\n";
90
83
}
91
84
next($array);
92
85
}
...
...
@@ -96,9 +89,9 @@ while ($fruit_name = current($array)) {
96
89
&example.outputs;
97
90
<screen>
98
91
<![CDATA[
99
-
fruit1<br />
100
-
fruit4<br />
101
-
fruit5<br />
92
+
fruit1
93
+
fruit4
94
+
fruit5
102
95
]]>
103
96
</screen>
104
97
</example>
...
...
@@ -110,12 +103,12 @@ fruit5<br />
110
103
<simplelist>
111
104
<member><function>current</function></member>
112
105
<member><function>next</function></member>
106
+
<member><function>array_key_first</function></member>
113
107
<member><link linkend="control-structures.foreach">foreach</link></member>
114
108
</simplelist>
115
109
</para>
116
110
</refsect1>
117
111
</refentry>
118
-

119
112
<!-- Keep this comment at the end of the file
120
113
Local variables:
121
114
mode: sgml
122
115