title: PHP: Last key of Object
body: <p>I know that some array functions, such as array_rand, work for objects as long as you put (array) in front of the object.  In this case I am trying to get the ID of the </p>
  
  <pre><code> $this-&gt;id = end($this-&gt;log-&gt;r);
  </code></pre>
  
  <p>this returns all of the elements in the last element.  I just want to know what the key of that element is.  This is a JSON_decoded object. </p>