|
|
|
|
|
by randallsquared
5287 days ago
|
|
But they're not arrays. JavaScript and Lua do the same thing, allowing you to assign numeric or hashed keys on objects (or tables in Lua), but they don't call them Arrays, because they aren't. PHP's arrays combine both vectors and associative arrays, but both numerically indexed arrays and associative arrays are types of arrays, are they not? Arrays have expected behavior and implementations. So do hash maps. It's fine to amalgamate them, just give it the right name. Whether associative arrays use hash maps underneath is an implementation detail, not fundamental to the interface PHP provides to [associative] arrays. |
|