Hi All!
Okay, below is a bacis piece of code that I'm trying to build a news engine from:
class NewsStory
{
var $NewsID;
var $Author;
var $Headline;
var $TimeStamp;
var $NewsText;
function NewsStory($NewsID = "", $newHeadline = "", $newNewsText = "", $newAuthor = "", $newTimestamp = "")
{
$this->Author = $newAuthor;
$this->Headline = $newHeadline;
$this->Timestamp = $newTimestamp;
$this->NewsText = $newNewsText;
}
}
class News
{
var $Stories;
function News()
{
$this->Stories = array();
$this->Stories[] = new NewsStory();
$this->Stories[] = new NewsStory();
}
}
$NewsMain = new News();
$NewsMain->Stories[0]->NewsID = 5;
Now, why on my server running PHP3 does the last line generate a parse error when on my system running PHP4 it doesn't?
Is there any work around for it?
Have I just got it completely wrong?
Help!!!!!!!!