Hi,
I am using PHP 4 with classes but I have come across a slight problem...
I can't declare an array as a property of a class, ie,
class clTest
{
var $a[];
clTest()
{
// ...some stuff here...
}
DoAdd($name, $content)
{
$this->a[] = array("name" => $id, "content" => $content);
}
}
This produces the error,
Parse error: parse error, expecting `','' or `';'' in
/srv/www/htdocs/test/table.php on line 10
line 10 is the "var $a[]".
Am I missing something out or doesn't PHP4 allow arrays as properties?
Julian
I am using PHP 4 with classes but I have come across a slight problem...
I can't declare an array as a property of a class, ie,
class clTest
{
var $a[];
clTest()
{
// ...some stuff here...
}
DoAdd($name, $content)
{
$this->a[] = array("name" => $id, "content" => $content);
}
}
This produces the error,
Parse error: parse error, expecting `','' or `';'' in
/srv/www/htdocs/test/table.php on line 10
line 10 is the "var $a[]".
Am I missing something out or doesn't PHP4 allow arrays as properties?
Julian
Comment