From: Phillip Hutchings Date: 2006-07-26T07:35:33+09:00 Subject: Re: Hash order bug? > 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. Disclaimer: My day job is working with a large PHP webapp. Maybe I'm just jaded. I believe it's fair. It's one of my reasons for liking Ruby (and Python, and JavaScript for that matter). Arrays and hashes are one of the most widely used structures in my development, and to have such a clumsy constructor is a pain. However, there are much deeper issues in PHP's implementation. There are a few array operations (eg array_merge) that will preserve key mappings on string keys, but not integer keys. Guess what happens if you want a hash with integer keys? -- Phillip Hutchings http://www.sitharus.com/