PHPackages                             rikudou/array-merge-recursive - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rikudou/array-merge-recursive

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rikudou/array-merge-recursive
=============================

Replacement of built-in array\_merge\_recursive function that doesn't add values to array but replaces them

v1.0.3(5y ago)7131.0k↓36.4%2WTFPLPHPPHP ^7.3|^8.0CI failing

Since Aug 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/RikudouSage/ArrayMergeRecursive)[ Packagist](https://packagist.org/packages/rikudou/array-merge-recursive)[ RSS](/packages/rikudou-array-merge-recursive/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (4)Versions (6)Used By (2)

array\_merge\_recursive replacement
===================================

[](#array_merge_recursive-replacement)

[![Tests](https://github.com/RikudouSage/ArrayMergeRecursive/actions/workflows/test.yaml/badge.svg)](https://github.com/RikudouSage/ArrayMergeRecursive/actions/workflows/test.yaml)[![Code Quality](https://camo.githubusercontent.com/748db8c8ea5dde9c3f9567f6aacccef714fa41ffae2650a4c3aa88dbb2249c33/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3838303765313261333330373435616639633037656335633931393631663237)](https://app.codacy.com/gh/RikudouSage/ArrayMergeRecursive)[![Coverage Status](https://camo.githubusercontent.com/9b4b53d09eccf4206d465adde6d35de575cf0e4b1b8f5414165321e4fff974ec/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f52696b75646f75536167652f41727261794d657267655265637572736976652f6d61737465722e737667)](https://coveralls.io/github/RikudouSage/ArrayMergeRecursive?branch=master)[![Download](https://camo.githubusercontent.com/fac8d5a08dec6b80620a9d8f5e26c7f8f2e2b545a86e369ff3d715fc99109832/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72696b75646f752f61727261792d6d657267652d7265637572736976652e737667)](https://packagist.org/packages/rikudou/array-merge-recursive)

Installation
------------

[](#installation)

`composer require rikudou/array-merge-recursive`

Description
-----------

[](#description)

The php function [`array_merge_recursive`](https://www.php.net/manual/en/function.array-merge-recursive.php)behaves a little confusingly and not at all like [`array_merge`](https://www.php.net/manual/en/function.array-merge.php).

Example of confusing behavior:

```
