Sen sınıf bildiriminde bir ifade olamaz.
Ben de yolu geçen öneririm:
public function __construct($path)
{
$this->debug_path = $path;
}
Bu size hiç yolunu değiştirmek istiyorsanız, sen içeri geçmek sadece ne, sürekli değiştirmek zorunda değilsiniz daha fazla esneklik verir
Yoksa tüm farklı yolları var birden çok nesne oluşturmak olabilir. Eğer birden çok dizinleri yüklemek isteyebilirsiniz gibi, bir autoloader sınıf ise, bu yararlıdır.
$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 ....
}