content = $content; } public function decorator(){ return $this->content; }}//编辑文章摘要class BianArt extends BaseArt { public function __construct(BaseArt $art){ $this->art = $art; } public function decorator(){ return $this->content = $this->art->decorator() . ',小编加上文章摘要'; }}class SEOart extends BaseArt { public function __construct(BaseArt $art){ $this->art = $art; } public function decorator(){ return $this->content = $this->art->decorator() . ',SEO加上关键词'; }}$b = new SEOart(new BianArt(new BaseArt('天天向上')));echo $b->decorator();