Такое дело:
<?php
class AutoLoader
{
protected $classname;
const classFolder = 'Class/';
private function __construct($classname) {
$this->classname = $classname;
}
protected function Test() {
return method_exists($this->classname, '__test') ? $this->classname::__test() : true; // unexpected "::" operator at this line.
}
protected function GetFilePath() {
return self::classFolder.str_replace('\\', DIRECTORY_SEPARATOR, $this->classname);
}
public static function Load($classname) {
$this = new self($classname);
$filepath = self::GetFilePath();
return file_exists($filepath) && include_once($filepath) && self::Test();
}
}