Fix PHP Fatal error:  Using $this when not in object context

Change ``$this->year`` to right context ``$year``.