reference/array/functions/in-array.xml
8cd7c0d8c574903e149c1da0689a8728cdf909d4
...
...
@@ -53,6 +53,14 @@
53
53
<link linkend="language.types">types</link> of the
54
54
<parameter>needle</parameter> in the <parameter>haystack</parameter>.
55
55
</para>
56
+
<note>
57
+
<para>
58
+
Prior to PHP 8.0.0, a <literal>string</literal> <parameter>needle</parameter> will match an array
59
+
value of <literal>0</literal> in non-strict mode, and vice versa. That may lead to undesireable
60
+
results. Similar edge cases exist for other types, as well. If not absolutely certain of the
61
+
types of values involved, always use the <parameter>strict</parameter> flag to avoid unexpected behavior.
62
+
</para>
63
+
</note>
56
64
</listitem>
57
65
</varlistentry>
58
66
</variablelist>
...
...
@@ -152,6 +160,7 @@ if (in_array('o', $a)) {
152
160
</example>
153
161
</para>
154
162
</refsect1>
163
+

155
164
<refsect1 role="seealso">
156
165
&reftitle.seealso;
157
166
<para>
158
167