关于php中str_replace的有关问题

关于php中str_replace的问题
public function display(){
        ob_start();
        if(preg_match_all('/(<\?php\s(.*?)\?>?)/s',$this->content,$match)){
            $find = $match[1];
            $_replace = array();
            foreach($match[2] as $_match){
                eval($_match);
                $_replace[] = ob_get_contents();
                ob_clean();
            }
            ob_flush();
            str_replace($find,$_replace,$this->content,$i);
        }
        header('Content-type:text/html;charset=UTF-8');
        var_dump($this->content);
        var_dump($match[1]);
        var_dump($i);
        ob_end_flush();
    }

我写了一段解析模板的代码,如上;现在执行之后出现了像下面图片上显示的结果,关于php中str_replace的有关问题,看图上显示应该是已经匹配到了字符串,但是为什么之后显示的结果却不是replace数组中的值呢
------解决思路----------------------
如果你希望我们帮你调试,那么请给出测试数据

你的这段代码只需这样就可以了
public function display() {
  ob_start();
  eval('?>' . $this->content);
  $this->content = ob_get_clean();
}