derek Thu Dec 23 03:34:20 2004 EDT
Modified files:
/phpdoc/en/reference/array/functions array-merge.xml
Log:
note 48406 integration
http://cvs.php.net/diff.php/phpdoc/en/reference/array/functions/array-merge.xml?r1=1.14&r2=1.15&ty=u
Index: phpdoc/en/reference/array/functions/array-merge.xml
diff -u phpdoc/en/reference/array/functions/array-merge.xml:1.14
phpdoc/en/reference/array/functions/array-merge.xml:1.15
--- phpdoc/en/reference/array/functions/array-merge.xml:1.14 Mon Nov 1
07:39:24 2004
+++ phpdoc/en/reference/array/functions/array-merge.xml Thu Dec 23 03:34:20 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.14 $ -->
+<!-- $Revision: 1.15 $ -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
<refentry id="function.array-merge">
<refnamediv>
@@ -152,6 +152,37 @@
Shared keys will be overwritten on a first-come first-served basis.
</para>
</note>
+ <warning>
+ <para>
+ The behavior of <function>array_merge</function> was modified in PHP 5.
Unlike PHP 4, <function>array_merge</function>
+ now only accepts parameters of type <type>array</type>. However, you can
use typecasting
+ to merge other types. See the example below for details.
+ </para>
+ <para>
+ <example>
+ <title><function>array_merge</function> PHP 5 example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$beginning = 'foo';
+$end = array(1 => 'bar');
+$result = array_merge((array)$beginning, (array)$end);
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen role="php">
+<![CDATA[
+Array
+(
+ [0] => foo
+ [1] => bar
+)
+]]>
+ </screen>
+ </example>
+ </para>
+ </warning>
<para>
See also <function>array_merge_recursive</function>,
<function>array_combine</function> and