PHP TVDB Trying to get property of non-object
<p>I am trying to figure out how to use this TV show library PHPTVDB. The $show is correct and gives the expected output. The problem is the $episode. I get error Trying to get property of non-object ($episode).</p>

<pre><code>class Foo {

 public functionTvShow() {

    $shows = TV_Shows::search('The Office');
    /* get the first show */
    $show = $shows[0];   
    $episode = $show-&gt;getEpisode(2, 4); 

    return "
        &lt;div&gt;
         &lt;h2&gt;Show: $show-&gt;seriesName&lt;/h2&gt;
                     &lt;p&gt;$show-&gt;overview&lt;/p&gt;

                     &lt;h3&gt;Episode:  $episode-&gt;name &lt;/h3&gt;
                     &lt;p&gt; $episode-&gt;overview &lt;/p&gt;
                   &lt;/div&gt;

    ";
}
</code></pre>

<p>From the library class:</p>

<pre><code> function __construct($config) {

                    $this-&gt;id = (string)$config-&gt;id;
                    $this-&gt;seriesName = (string)$config-&gt;SeriesName;
                    $this-&gt;status = (string)$config-&gt;Status;
                    $this-&gt;firstAired = strtotime((string)$config-&gt;FirstAired);
                    $this-&gt;network = (string)$config-&gt;Network;
                    $this-&gt;runtime = (string)$config-&gt;Runtime;
                    $this-&gt;genres = $this-&gt;removeEmptyIndexes(explode('|', (string)$config-&gt;Genre));
                    $this-&gt;actors = $this-&gt;removeEmptyIndexes(explode('|', (string)$config-&gt;Actors));
                    $this-&gt;overview = (string)$config-&gt;Overview;
                    $this-&gt;dayOfWeek = (string)$config-&gt;Airs_DayOfWeek;
                    $this-&gt;airTime = (string)$config-&gt;Airs_Time;
                    $this-&gt;rating = (string)$config-&gt;Rating;
                    $this-&gt;imdbId = (string)$config-&gt;IMDB_ID;
                    $this-&gt;zap2ItId = (string)$config-&gt;zap2it_id;
            }


            /**
             * Get a specific episode by season and episode number
             *
             * @var int $season required the season number
             * @var int $episode required the episode number
             * @return TV_Episode 
             **/
            public function getEpisode($season, $episode) {
                    $params = array('action' =&gt; 'get_episode', 
                                                    'season' =&gt; (int)$season, 
                                                    'episode' =&gt; (int)$episode,
                                                    'show_id' =&gt; $this-&gt;id);

                    $data = self::request($params);

                    if ($data) {
                            $xml = simplexml_load_string($data);
                            return new TV_Episode($xml-&gt;Episode);
                    } else {
                            return false;
                    }
            }
</code></pre>

<p>So the problem is $episode,it is false and I don´t understad why?       </p>
