Serialize linked or ordered structure

if I serialize a linked CFML structure the resulting output will not evaluate to a linked structure.

<cfset tmp = [:]>
<cfset tmp['linked'] = ["validate":"false","secure":"checkpoint"]>
<cfset tmp['serialized'] = serialize( tmp.linked )>
<cfset tmp['result']   = evaluate( tmp.serialized )>
<cfset tmp['fromJSON'] = deserializeJSON( tmp.serialized )>

<cfdump var="#tmp#">

Not sure why deserializeJSON() returns a linked structure but that is a workaround.

@apenhorwood, I made a test as per what you said. I can able to evaluate the serialized structure. Do you face any issue when evaluate the structure?

The problem is not with evaluating the structure but that the resulting structure is no longer a linked structure.

linked: [“validate”:“false”,“secure”:“checkpoint”]
normal: {“validate”:“false”,“secure”:“checkpoint”}

Linked structures keep their order and normal structures the order of keys are not guaranteed. In my case I need the order of keys to be deterministic. I am serializing the structure to a file and reading it back in later.

The serialize() function only produces normal structures even though the original structure was a linked structure.

Personally it sounds like a bug to me.