Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Merge does not work when providing numerical array keys #1996
Merge filter does not work when trying to provide numerical array keys.
If the key is 0 or "0", it will NOT be replaced, however if a string array key is used such as "someKey", the actual value matching "someKey" is replaced.
What does not work:
This may be a bug with PHP array_merge function, if so, should it be reported?
This behavior doesn't seem logical to me. Not to me and I'm not the only one having this opinion.
Is array_replace usable in Twig for numerical indexes?