title: Determine whether an array is associative (hash) or not
body: <p>I'd like to be able to pass an array to a function and have the function behave differently depending on whether it's a "list" style array or a "hash" style array. E.g.:</p>
  
  <pre><code>myfunc(array("One", "Two", "Three")); // works
  myfunc(array(1=&gt;"One", 2=&gt;"Two", 3=&gt;"Three")); also works, but understands it's a hash
  </code></pre>
  
  <p>Might output something like:</p>
  
  <pre><code>One, Two, Three
  1=One, 2=Two, 3=Three
  </code></pre>
  
  <p>ie: the function does something differently when it "detects" it's being passed a hash rather than an array. Can you tell I'm coming from a Perl background where %hashes are different references from @arrays?</p>
  
  <p>I believe my example is significant because we can't just test to see whether the key is numeric, because you could very well be using numeric keys in your hash.</p>
  
  <p>I'm specifically looking to avoid having to use the messier construct of <code>myfunc(array(array(1=&gt;"One"), array(2=&gt;"Two"), array(3=&gt;"Three")))</code></p>