Other way to merge config parameters

I suggest using array_replace_recursive instead of array_merge. In this way, in addition to keep the overriding feature, the key/value pairs which don't exist in the default or new array will still be  kept in the final array.