Stéphane Payrard wrote:

On Wed, Jan 29, 2003 at 09:44:27AM -0500, Aaron Sherman wrote:

Yes, I would expect that. In my opinion there is no difference between
an array and a hash other than the underlying storage and the
type-management of the key. I'm increasingly of the opinion that a)
there should be no @ vs %, there should be no {} vs [], there should be
a keys, values, defined, delete, exists, push, pop, shift, unshift for
every container and foreach shouldn't give a damn.

I think that arrays and associative tables are very different entities
for two reasons:
-type of keys. array keys are integers
-cost of insertion and deletion operations: O(n) and
lower for associative table ( O(1) if you don't care for key ordering,
O(log(n)) if you care for ordering).
This is enough to warrant different syntaxes for arrays and hash.

I'm sure I'll get shot for saying this, but no it doesn't.  PHP arrays
are simply associative arrays with a integer as the key value.

Of course, this doesn't mean I like the idea, but I just wanted to
point out that there are some languages that do it this way.  However,
I hope that we are not going to be one of those.


Joseph F. Ryan
[EMAIL PROTECTED]

Reply via email to