title: How does PHP count objects in multidimensional arrays?
body: <p>While I was learning about a count function for arrays and looking at some examples I noticed something I don't understand. Can you clarify me the behavior in the example below.</p>
  
  <p>I read how count function works in PHP manual and I know that the second parameter in function means that it will recursively count the array.</p>
  
  <pre><code>&lt;?php
  $fruits = array ("apple", "orange", array("pear" , "mango"), "banana");
  echo (count($fruits,1));
  </code></pre>
  
  <p>So the result without 1 as the second parameter should be 4 and with it should be 5, yet I get 6 as the output.</p>