重命名JSON对象属性,但保持其在PHP中的位置

I have a JSON object that looks something like so:

$jsonObj = {
    "groups": {
        "first" : {...},
        "second: {
            "Old Name" : {...},
            "others": {...}
        },
        "third": {...}
    }
};

I want to change the property name "Old Name" to "New Name" but keep it as first property in its parent ("second"). Is it possible to achieve it?

(of course I can assign a new property to "second" and unset the old one but that will position it at the end of the object and that's not the result I'm looking for).

position in json is undetermined so it is an unordered collection of properties...

The order in an object is not guaranteed. If you want to maintain order, you have to store the objects in an array.

Change the key and store the object in an array at the same time.

Do something like ...second["new one"=>{...},"others"=>{}].....