title: How to get the number of keys in a php object
body: <p>I have an arrays object whith one key user, and i try to get the size of this key, the sizeOf function return 6. But if i have more than one key user in my object then sizeOf return the number of key user.</p>
  
  <p>Here is an exemple of my object :</p>
  
  <pre><code>object(Context)[347]
  protected 'values' =&gt; 
  array (size=23)
    [...]
    'user' =&gt; 
      array (size=6)
        'nom' =&gt; 
          array (size=2)
            '@content' =&gt; string 'foo' (length=6)
            '@attributes' =&gt; 
  
        'email' =&gt; string 'foon@yahoo.fr' (length=24)
    [...]
  </code></pre>
  
  <p>What the best way to get the number of user key in my object ?</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>With multiple users i got this</p>
  
  <pre><code>object(Context)[347]
  protected 'values' =&gt; 
  array (size=23)
    [...]
    'user' =&gt; 
      array (size=2)
        0 =&gt; 
          array (size=6)
            'nom' =&gt; 
              array (size=2)
                '@content' =&gt; string 'foo' (length=6)
            'email' =&gt; string 'foo@yahoo.fr' (length=24)
        1 =&gt; 
          array (size=6)
            'nom' =&gt; 
              array (size=2)
                '@content' =&gt; string 'bar' (length=6)
            'email' =&gt; string 'bar@yahoo.fr' (length=24)
  </code></pre>