On Fri, Aug 17, 2012 at 11:35 PM, Rasmus Schultz <ras...@mindplay.dk> wrote:
> Most other languages have more than one collection-type... since PHP has
> only the single, hybrid array-type which acts both as a hash and as an
> array, something like this ought to be available.
>
> I don't know why everyone is so eager to jump up and argue against
> something this simple, basic and useful. The fact that this is missing is
> an oversight - just look at the number of solutions people come up with.
> For what?
Could we please stop these pseudo-arguments? "simple, basic and
useful. The fact that this is missing is an oversight"? Do you have
anything to back up these claims? I can't remember to have been in a
situation where I wanted to remove a value from an array. Simply
because that's a slow operation. When you have to do it you *usually*
have chosen the wrong datastructure. And in the cases where you do
need it, you can easily do it with array_search. Where is the issue?

Also, as I already pointed out, "removing a value from an array" is
not well defined. Do you mean to only remove the first occurrence of
the value? Only the last? All of them? Do you want to have special
functions for all of those?

Furthermore, why do you keep coming back to the "There exists more
than one solution to this problem" argument? Everything can be done in
a large number of ways. And people come up with a lot of ways,
depending on the situation. You can output a string with echo, with
print, with concatenation, with interpolation, with multi-arg echo,
with printf, etc. So sure, there are also multiple ways to remove
values from an array. What's the issue with that?

Nikita

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to