title: How to hide error "Trying to get property of non-object"
body: <p>I have the following code, which works correctly. The Twitter Friends are listed correctly, however it seems that when the last item is displayed the error "Notice: Trying to get property of non-object" is displayed 4 times. </p>
  
  <p>Since the code works as it should, I would like a way to hide these errors. </p>
  
  <pre><code>$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
  $tweets6 = $connection-&gt;get("https://api.twitter.com/1.1/friends/list.json?screen_name=".$twitteruser."&amp;count=".$notweets);
  foreach ($tweets6 as $tweet)
  {
      for($i = 0; $i &lt; count($tweet); $i++)
      {
          echo $tweet[$i] -&gt; name;
          echo "&lt;br /&gt;";
      }
  }
  </code></pre>