Sarah Savage on Nostr: Use objects, not arrays, for predictable data that you're returning from a function. ...
Use objects, not arrays, for predictable data that you're returning from a function.
Objects can be typed, and they're predictable. Forget or add an array key, and all of a sudden your return value is not stable.
#php
Published at
2024-06-12 19:20:02Event JSON
{
"id": "5770ad0aa9a77afad11da0afbf962326783395a6cf8bddc65c3c8f33b0c89075",
"pubkey": "92cc97feb3e565090ab5fb5dffe64fe270acc46cdc0c901d444f48a4f837567f",
"created_at": 1718220002,
"kind": 1,
"tags": [
[
"t",
"php"
],
[
"proxy",
"https://phpc.social/users/sarah/statuses/112605266063701811",
"activitypub"
]
],
"content": "Use objects, not arrays, for predictable data that you're returning from a function.\n\nObjects can be typed, and they're predictable. Forget or add an array key, and all of a sudden your return value is not stable.\n\n#php",
"sig": "b0f35105e8f1a063dea3e19aff5ef2c435a9c21a8e21bbf5ca1db241dd1eeebfb5fefaba77960c34e7c3569ee5b4cc2ac4b82b268ac93927d051df11ada48ecd"
}