You cannot have an expression in a class declaration.
I would suggest passing the path in:
public function __construct($path)
{
$this->debug_path = $path;
}
This gives you more flexibility if you ever want to change the path, you don't have to change a constant, just what you pass in.
Or you could create multiple objects that all have different paths. This is useful if it is an autoloader class, as you might want to have it load multiple directories.
$autoloader = new Autoload(dirname(SYS_PATH));
$autoloader->register_loader();
class Autoload
{
public $include_path = "";
public function __construct($include_path="")
{
// Set the Include Path
// TODO: Sanitize Include Path (Remove Trailing Slash)
if(!empty($include_path))
{
$this->include_path = $include_path;
}
else
{
$this->include_path = get_include_path();
}
// Check the directory exists.
if(!file_exists($this->include_path))
{
throw new Exception("Bad Include Path Given");
}
}
// .... more stuff ....
}