Open andser opened 5 years ago
This is the intended functionality however, I understand the confusion. The reason for this is due to the use of array_replace_recursive
for merging the config arrays (see here). This is necessary to support merging of multi-dimensional arrays properly. For example:
$one = new Config([
'database' => [
'server' => '192.168.0.10',
'port' => 3306
]
]);
$two = new Config([
'database' => [
'server' => '10.10.0.5'
]
]);
$one->merge($two);
Results in the following config array:
[
'database' => [
'server' => '10.10.0.5',
'port' => 3306
]
]
This unfortunately breaks when the value of the top-level option is an array that is intended to be treated as an individual value. I don't currently have a work around for this but will keep this issue open to remind me to think about it and hopefully find a long-term solution.
Hello! Trying to use your lib, but faced a problem:
It returns:
But should return: