On 5/5/2017 12:00 AM, Rowan Collins wrote: > On 04/05/2017 13:51, Michael Morris wrote: >> For what it's worth, the Drupal assertion inspector calls these "Strict >> Arrays" since that's what they are - arrays in the true sense of the term >> found in all other languages. What PHP is calling an "array" is more >> accurately a "map" or "hash" > > I'm not sure on that terminology. Many languages / environments have > "sparse" arrays, arrays with negative indexes, and other variants. It's > true that PHP's "array" type goes well beyond those, but we're talking > about more than "non-associative" here (or I hope we are). > > I think possibly the best term would be "list" - a collection where > order is preserved, but there is no separate notion of keys: on a > "list-like array", $foo[42] can be seen as "access the 43rd value", not > "access the value with key 42". > > Regards, >
The terminology here is, as is often the case, very blurry. Many programming languages call resizable arrays vectors. Most often this stems from the actual implementation, or simply because they require a different name for the keyword. In Java it would be `ArrayList`, whereas `Vector` is the thread-safe counter-part to it. However, I think that vector is the best name. -- Richard "Fleshgrinder" Fussenegger
signature.asc
Description: OpenPGP digital signature