Mam następujący problemik:
Wyskakuje mi błąd: Notice: Undefined variable: errors in...
class LogErrors { public function add($value) { $errors[] = "$value"; } public function show() { return $errors; } } $test = new LogErrors; $test -> add('100'); $test -> add('200'); $test -> add('300'); $test -> show();
Czemu nie widzi zmiennej $errors w całej klasie? Kiedyś robiłem coś podobnego i działało a teraz nie bardzo...