title: How is the PHP array implemented on the C level?
body: <p>The PHP <code>array</code> is one of PHP's core features. It is sparse, allows multi-typed keys in the same array, and supports set, dictionary, array, stack/queue and iterative functionality.</p>
  
  <p>But after working with PHP for a while now, I've found that quite a few of the <code>array_*</code> functions are much slower than you'd think at first glance. Like in the case of <code>array_rand</code> on a very large array (10000+). <code>array_rand</code> is so slow in fact, that in cases where your using the php array as an indexed array, a function like <code>rand( 0, array_length( $array ) - 1 )</code> runs MUCH faster than <code>array_rand</code>.</p>
  
  <p>Now onto my question.</p>
  
  <p><strong>How is the PHP array implemented on the C level?</strong> This would be very helpful for predicting the Big O of a function that heavily uses the different functionality of the PHP array datatype.</p>