Timeline for Hard PHP nut : how to insert items into one associate array?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 10, 2011 at 20:55 | comment | added | AlexanderJohannesen | yes, of course, and I'm starting to lean that way. First I'll see how expensive the insert/seek operation on an array is, and if proven bad I'll do exactly that. :) It just seemed like a hashmap with internal pointer would have at least a way to set the pointer by key, but I may have to go all OO on 'im to make it snappy enough. | |
May 10, 2011 at 8:04 | comment | added | outis |
@Alexander: if a built-in data structure doesn't meet your needs, your best bet is to implement your own. With an event queue class, you can implement the Iterator and ArrayAccess interfaces. It will function as an array, but will give you greater control over positioning. You can even add methods to get and set the position (possibly using overloading).
|
|
May 9, 2011 at 4:02 | comment | added | AlexanderJohannesen | Yes, that's one way, although my app rely on the keys for other things. Perhaps it needs to be split, leaving more serializing work to be done, but maybe there is no better way? Hmm. | |
May 9, 2011 at 3:58 | history | edited | outis | CC BY-SA 3.0 |
added 95 characters in body
|
May 9, 2011 at 3:48 | history | answered | outis | CC BY-SA 3.0 |