и, кстати, выведите $ currentDir. "\ П"; используйте $ this при вызове vars в классе
у я не могу установить открытую переменную-член с помощью функции?
<?
class TestClass {
public $thisWorks = "something";
public $currentDir = dirname( __FILE__ );
public function TestClass()
{
print $this->thisWorks . "\n";
print $this->currentDir . "\n";
}
}
$myClass = new TestClass();
?>
Запуск это дает:
Parse error: syntax error, unexpected '(', expecting ',' or ';' in /tmp/tmp.php on line 7