class nazwa { public $atrybut; public function operacja($param) { $this->$atrybut = $param; } }
Zamieniłem tylko nazwę klasy.
Potem dodałem:
$n = new nazwa(); $n->operacja(2);
I Wamp Server wyświetla mi:
Notice: Undefined variable: atrybut in C:\wamp\www\Nauka\index.php on line 8
Fatal error: Cannot access empty property in C:\wamp\www\Nauka\index.php on line 8
co oznaczają te błędy?