title: Call a member function on a non object
body: <p>i want to display informations about object <code>Activity</code> that the function <code>getCurrent()</code> from the <code>ListActivity</code> should returns. 
  When i try it, it works perfectly, i have the information needed from the class, but, i have this error message on the top of the page : </p>
  
  <blockquote>
    <p>Fatal error: Call to a member function getIdentifiant() on a
    non-object in
    /Applications/XAMPP/xamppfiles/htdocs/site/prototype/administration.php
    on line 34</p>
  </blockquote>
  
  <p>Line 34 is here : </p>
  
  <pre><code>  while($listActivities-&gt;next())
    {
       $current = new Activity();
       $current = $listActivities-&gt;getCurrent();
       echo $current-&gt;getId(); // line 34
    }
  </code></pre>
  
  <p>And this is the <code>getCurrent()</code> function which return an Activity object. </p>
  
  <pre><code>  public function getCurrent()
    {
       if(isset($this-&gt;activities[$this-&gt;current]))
          return $this-&gt;activities[$this-&gt;current];
    }
  </code></pre>
  
  <p>I don't understand why i have this problem since it returns me the object that i want. 
  Please help me figuring it out. Thanks. </p>