From: Keith Gaughan Date: 2006-07-26T07:28:56+09:00 Subject: Re: Hash order bug? On Wed, Jul 26, 2006 at 05:41:49AM +0900, Phillip Hutchings wrote: > >No. What language has ordered hashes? > > PHP (*shudder*). Since PHP only has a single array type that supports > both sequential and keyed accessing any string keys remain in order. > It can be handy as PHP's array construction is needlessly verbose, for > example in Ruby I'd do this: > > [['item1', 1],['item2',2]] > > In PHP it'd look like: > array(array('item1', 1), array('item2', 2)); > or > array('item1'=>1, 'item2'=>2); > > Which is easier to read? That's not really fair on either Ruby or PHP. You're taking a syntactical element and using it to bash an unrelated part of the language. If PHP was to introduce the use of square brackets as syntactic sugar for array(), this argument would go away in a puff of smoke. K. P.S. My .sig generator seems to think I'm talking about ASP.NET :-) -- Keith Gaughan - kmgaughan@eircom.net - http://talideon.com/ Many people are unenthusiastic about their work.