[doc-en] master: array_merge: document 8.0.0 TypeError for non-array arguments (#6112)

From: Date: Thu, 19 Nov 2026 09:26:23 +0000
Subject: [doc-en] master: array_merge: document 8.0.0 TypeError for non-array arguments (#6112)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23983@lists.php.net to get a copy of this message
Author: Vojtěch Houžvička (vojtech-houzvicka) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-11-19T10:26:20+01:00 Commit: https://github.com/php/doc-en/commit/5b7d0e3c7a1339ef0871851e4611dafcc75c4fb5 Raw diff: https://github.com/php/doc-en/commit/5b7d0e3c7a1339ef0871851e4611dafcc75c4fb5.diff array_merge: document 8.0.0 TypeError for non-array arguments (#6112) * array_merge: document 8.0.0 TypeError for non-array arguments * Update reference/array/functions/array-merge.xml Co-authored-by: Louis-Arnaud <la.catoire@gmail.com> * array_merge_recursive: document 8.0.0 TypeError for non-array arguments --------- Co-authored-by: Louis-Arnaud <la.catoire@gmail.com> Changed paths: M reference/array/functions/array-merge-recursive.xml M reference/array/functions/array-merge.xml Diff: diff --git a/reference/array/functions/array-merge-recursive.xml b/reference/array/functions/array-merge-recursive.xml index 9088e899a8d1..eb61122c5c6c 100644 --- a/reference/array/functions/array-merge-recursive.xml +++ b/reference/array/functions/array-merge-recursive.xml @@ -50,6 +50,13 @@ If called without any arguments, returns an empty &array;. </para> </refsect1> + <refsect1 role="errors"> + &reftitle.errors; + <simpara> + As of PHP 8.0.0, a <exceptionname>TypeError</exceptionname> is thrown if any argument is not an array. + Prior to PHP 8.0.0, an <constant>E_WARNING</constant> was emitted and &null; was returned instead. + </simpara> + </refsect1> <refsect1 role="changelog"> &reftitle.changelog; @@ -63,6 +70,15 @@ </row> </thead> <tbody> + <row> + <entry>8.0.0</entry> + <entry> + Now throws a <exceptionname>TypeError</exceptionname> + if any argument is not an array. + Previously, an <constant>E_WARNING</constant> was raised + and &null; was returned. + </entry> + </row> <row> <entry>7.4.0</entry> <entry> diff --git a/reference/array/functions/array-merge.xml b/reference/array/functions/array-merge.xml index 99f4d2f36009..2948fdc574d2 100644 --- a/reference/array/functions/array-merge.xml +++ b/reference/array/functions/array-merge.xml @@ -50,6 +50,13 @@ If called without any arguments, returns an empty &array;. </para> </refsect1> + <refsect1 role="errors"> + &reftitle.errors; + <simpara> + As of PHP 8.0.0, a <exceptionname>TypeError</exceptionname> is thrown if any argument is not an array. + Prior to PHP 8.0.0, an <constant>E_WARNING</constant> was emitted and &null; was returned instead. + </simpara> + </refsect1> <refsect1 role="changelog"> &reftitle.changelog; @@ -63,6 +70,15 @@ </row> </thead> <tbody> + <row> + <entry>8.0.0</entry> + <entry> + Now throws a <exceptionname>TypeError</exceptionname> + if any argument is not an array. + Previously, an <constant>E_WARNING</constant> was raised + and &null; was returned. + </entry> + </row> <row> <entry>7.4.0</entry> <entry>

« previous php.doc.cvs (#23983) next »