function toString() { if ($this->text) { return $this->text; } else { return get_class($this) . " error"; } }