mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
note 48406 integration
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@175457 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
fdcb318922
commit
6f05844f8e
1 changed files with 32 additions and 1 deletions
|
@ -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 @@ Array
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue