Lucee fails silently, ACF still appends the value
https://docs.lucee.org/reference/objects/array/append.html
Merge: This argument only applies when the value is an array.
If set to true appends array elements individually to the source array.
If false (default) the complete array is added as one element at the end, in the source array.
Lucee should either match the ACF behaviour or throw an exception
https://trycf.com/gist/1afad613dbc36a1ef0c06a51c3b59bbb/lucee5?theme=monokai
The explanation for this is found here:
https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/lucee/runtime/functions/arrays/ArrayAppend.java#L51
Lucee considers (among other things)
empty structs
structs with numeric keys
to be castable to an array.
So I disagree that it's strictly 'failing silently'. It's more that Lucee has a more loose sense of what an array is compared to Adobe CF, which I'm sure is important for the BIF to be able to work with native Java collections.
For compatibility, an additional check could be made to ensure that the object was not an explicit struct.
Added a test case for this issue.
i first was considering to only allow struct in case it also has content, but that could lead to even worse missunderstandings of the functionality, so i reduced the flixibility of the cast in that case, Struct are no longer considered as an array in that case.