reference/array/functions/array-key-exists.xml
89fe795cc8bcf1b5ff9eb894bff51f006db66a65
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.array-key-exists">
3
+
<refentry xml:id="function.array-key-exists" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>array_key_exists</refname>
6
6
<refpurpose>Checks if the given key or index exists in the array</refpurpose>
...
...
@@ -10,7 +10,7 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>bool</type><methodname>array_key_exists</methodname>
13
-
<methodparam><type>mixed</type><parameter>key</parameter></methodparam>
13
+
<methodparam><type class="union"><type>string</type><type>int</type><type>float</type><type>bool</type><type>resource</type><type>null</type></type><parameter>key</parameter></methodparam>
14
14
<methodparam><type>array</type><parameter>array</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
...
...
@@ -58,6 +58,31 @@
58
58
</note>
59
59
</refsect1>
60
60

61
+
<refsect1 role="changelog">
62
+
&reftitle.changelog;
63
+
<informaltable>
64
+
<tgroup cols="2">
65
+
<thead>
66
+
<row>
67
+
<entry>&Version;</entry>
68
+
<entry>&Description;</entry>
69
+
</row>
70
+
</thead>
71
+
<tbody>
72
+
<row>
73
+
<entry>8.0.0</entry>
74
+
<entry>
75
+
The <parameter>key</parameter> parameter now accepts
76
+
<parameter>bool</parameter>, <parameter>float</parameter>, <parameter>int</parameter>,
77
+
<parameter>null</parameter>, <parameter>resource</parameter>, and
78
+
<parameter>string</parameter> as arguments.
79
+
</entry>
80
+
</row>
81
+
</tbody>
82
+
</tgroup>
83
+
</informaltable>
84
+
</refsect1>
85
+

61
86
<refsect1 role="examples">
62
87
&reftitle.examples;
63
88
<para>
...
...
@@ -105,13 +130,12 @@ array_key_exists('first', $search_array);
105
130
For backward compatibility reasons, <function>array_key_exists</function>
106
131
will also return &true; if <parameter>key</parameter> is a property
107
132
defined within an <type>object</type> given as
108
-
<parameter>array</parameter>. This behaviour should not be relied upon,
109
-
and care should be taken to ensure that <parameter>array</parameter> is
110
-
an <type>array</type>.
133
+
<parameter>array</parameter>. This behaviour is deprecated as of PHP 7.4.0,
134
+
and removed as of PHP 8.0.0.
111
135
</para>
112
136
<para>
113
-
To check whether a property exists in an object, use
114
-
<function>property_exists</function>.
137
+
To check whether a property exists in an object,
138
+
<function>property_exists</function> should be used.
115
139
</para>
116
140
</note>
117
141
</refsect1>
...
...
@@ -128,7 +152,6 @@ array_key_exists('first', $search_array);
128
152
</para>
129
153
</refsect1>
130
154
</refentry>
131
-

132
155
<!-- Keep this comment at the end of the file
133
156
Local variables:
134
157
mode: sgml
135
158