PHP's docs claim that its array is optimized for use as "array, vector hash table, dictionary, collection, stack, queue, and probably more". Is this actually true (The optimized bit)? Or is it still just a pretty ok hash map implementation (also how does dict diff from hash?)
-
-
Replying to @sgrif
Yes, it's pretty decent for all these uses. It's an order-preserving hash table with special case optimizations for use as a numeric/dense array.
1 reply 0 retweets 0 likes -
Replying to @kornelski
Do you have a reference for the optimizations that they do for dense arrays I can look at?
1 reply 0 retweets 0 likes -
Replying to @kornelski
The insertion order caveat is unfortunate but makes sense. So it has optimizations for use as a vector, but no other cases that it claims, correct?
1 reply 0 retweets 0 likes -
Replying to @sgrif
Yes, it's something like either Python's list or ordereddict, depending on how you use it. It's idiomatic to take advantage of the stable insertion order when using it as a dict.
1 reply 0 retweets 1 like
Replying to @kornelski
Thanks! <3
6:24 PM - 13 Dec 2017
from Albuquerque, NM
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.