|
|
|
|
|
by e12e
1670 days ago
|
|
Is it really useful to have ordered map as the "only" collection type? I guess it might be Stockholm syndrome - but I'm quite comfortable with a "list/array" type (numeric keys, ordered) and a "map/hash_map" type (objects as keys). Especially give that with phps "power" you can: $array = array(
1 => "a",
"1" => "b",
1.5 => "c",
true => "d",
);
var_dump($array);
Ouputs: array(1) {
[1]=>
string(1) "d"
}
https://www.php.net/manual/en/language.types.array.php |
|
And for the record, it's not Stockholm syndrome, I use plenty of other languages and I know the benefits and drawbacks of each of those.