class Interface
{
// current group's ID
private $groupID = -1;
}
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homepages/38/d167792529/htdocs/temp/Interface.php on line 13
I was able to supress the error by changing “private” to “var”, but I would prefer it to be private…
Line 13 is that class field declaration. This is the upper half of my class:
<?php
// title: Interface.php
// author: ---
// date: 05/14/08
// purpose: Reused interface elements are put in functions to avoid redundant
// typing and to allow easy updatability.
// ============================================================================
class Layout
{
// current group's ID
private $groupID = -1;
// ========================================================================
// Interface
// args: int: ID number of the current group
// ret: none
// about: constructor
function __construct($id)
{
$this->groupID = $id;
}
In your constructor, where you set the value of $this->$groupID, it should be $this->groupID. You only use the dollar sign on the $this pseudo-variable.
Also, in setting the visibility, I think you can only do that in php 5.