The Lucee documentation states the following for structKeyArray()
:
For unsorted structs, Adobe returns a text sorted Array of keys, for performance reasons, Lucee simply returns the raw sort order
This statement is NOT correct.
Using the built-in cftry portion of the Lucee Docs
Shows that the returned array is indeed, sorted.
(Lucee 4.5, 5.4 and 6 - all return a sorted array.)
Either the documentation is wrong - or Lucee does not correctly implement its own spec.
2 Likes
Indeed, and adding to the confusion in that doc page is the term âunsorted structsâ, which should be âunordered structsâ.
keep in mind, CFDUMP can be misleading, as it sorts on display
try serializeJson()
or looping over the collection
1 Like
âAAAhhhhâ
I didnât know that cfdump automatically âsortsâ.
IS there any value in me logging a ticket to change it?
To me - cfdump shouldnât do anything like this - at least not implicitly.
lucee:6.1
â zspitzer:LDEV-4876-no-sort-struct-cfdump
opened 03:11PM - 31 May 24 UTC
https://luceeserver.atlassian.net/browse/LDEV-4876
but iâm thinking of maybe just annotating the display (sorted for display) like we do for ordered structs, as itâs nice being sorted after all, there is no guaranteed sort order otherwise and it will potentially change randomly
2 Likes