public function __construct($text) { // remove double spaces $text = mb_ereg_replace('\\s+', ' ', $text); // restore line breaks $text = str_replace(' ', "\n", $text); $this->text = $text; $this->tag = new Tag('text'); parent::__construct(); }