Skip to content

Commit 6955e47

Browse files
author
Dennis Weiershäuser
committed
Fixed and simplified array_replace description
1 parent 443531f commit 6955e47

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

reference/array/functions/array-replace.xml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,13 @@
1313
<methodparam rep="repeat"><type>array</type><parameter>replacements</parameter></methodparam>
1414
</methodsynopsis>
1515
<para>
16-
<function>array_replace</function> replaces the values of
17-
<parameter>array</parameter> with values having the same keys in each of the following
18-
arrays. If a key from the first array exists in the second array, its value
19-
will be replaced by the value from the second array. If the key exists in the
20-
second array, and not the first, it will be created in the first array.
21-
If a key only exists in the first array, it will be left as is.
22-
If several arrays are passed for replacement, they will be processed
23-
in order, the later arrays overwriting the previous values.
16+
<function>array_replace</function> is not mutating
2417
</para>
2518
<para>
26-
<function>array_replace</function> is not recursive : it will replace
27-
values in the first array by whatever type is in the second array.
19+
<function>array_replace</function> is not recursive
20+
</para>
21+
<para>
22+
<function>array_replace</function> creates a new array by joining all given arrays in given order, replacing values of already existing keys.
2823
</para>
2924
</refsect1>
3025
<refsect1 role="parameters">

0 commit comments

Comments
 (0)