|
|
|
|
|
by hu3
687 days ago
|
|
> arrays being sorted maps has to be one of the worst design decisions. I'm curious, why is that so bad? It tends to be a useful property of PHP arrays. Also for webdevelopment, I/O is often the bottleneck. This code creates an array with 1 million items, each being 'a' and then loops over each value, changing them to 'b': $array = array_fill(0, 1000000, 'a');
foreach ($array as $key => $value) {
$array[$key] = 'b';
}
It executes in 2ms on my machine.How often do you need to create and change each element of a million item array? A roundtrip TCP/IP call to PostgreSQL is bound to be slower than that for most web servers. |
|
It does hint that perhaps bearjaws is (lucky for them!) too young to remember the mess that incomplete implementation of array/object duality got the JS world into.