title: Calculate frequency of values in the array
body: <p>I need to calculate the frequency of all values in the array <code>$inputArr</code> in order to build frequency histogram.</p>
  
  <pre><code>$query="SELECT delay FROM TestDB;";
  $result=DatabaseConnector::ExecuteQueryArray($query);
  $inputArr = array();
  foreach ($result as $row) {
      $inputArr[] = array($row['delay']);
  }
  
  $freq = array_count_values ($inputArr);
  </code></pre>
  
  <p>But <code>var_dump($freq)</code> returns array(0). It's strange, because <code>var_dump($inputArr)</code> returns the following result (just a sample):</p>
  
  <pre><code>array(429) {
      [0]=&gt;  array(1) { [0]=&gt;  string(1) "0" }
      [1]=&gt;  array(1) { [0]=&gt;  string(1) "0" }
      [2]=&gt;  array(1) { [0]=&gt;  string(1) "0" }
      [3]=&gt;  array(1) { [0]=&gt;  string(1) "9" }
      [4]=&gt;  array(1) { [0]=&gt;  string(2) "12" }
      [5]=&gt;  array(1) { [0]=&gt;  string(1) "7" }
      [6]=&gt;  array(1) { [0]=&gt;  string(2) "15" }
      [7]=&gt;  array(1) { [0]=&gt;  string(1) "3" }
      [8]=&gt;  array(1) { [0]=&gt;  string(2) "13" }
      [9]=&gt;  array(1) { [0]=&gt;  string(1) "0" }
      [10]=&gt;  array(1) { [0]=&gt;  string(1) "1" }
      [11]=&gt;  array(1) { [0]=&gt;  string(2) "35" }
      [12]=&gt;  array(1) { [0]=&gt;  string(2) "24" }
      [13]=&gt;  array(1) { [0]=&gt;  string(2) "14" }
      [14]=&gt;  array(1) { [0]=&gt;  string(1) "4" }
      [15]=&gt;  array(1) { [0]=&gt;  string(1) "0" }
      [16]=&gt;  array(1) { [0]=&gt;  string(2) "26" }
      [17]=&gt;  array(1) { [0]=&gt;  string(1) "0" }
  </code></pre>
  
  <p>As it can be seen from this output, <code>inputArr</code> has repeating values, e.g. 0.
  So, why <code>$freq = array(0)</code>?</p>