PHP output buffering callback yielding blank scree

2019-03-04 14:32发布

Here is the code:

 ob_start(array(&$dispatcher, 'outputCallback')); 
 include($file);
 ob_end_flush();

 function outputCallback($string) {
    if(ob_get_level() == 1) { 
        $static =& ParserStatic::getInstance();
        return $static->insertToppings($string);
    }
    return false;
  }

The problem is when I return $string it behaves OK, but when it executes the object assignment, it gives a blank screen. What's going wrong?

标签: php callback
1条回答
来,给爷笑一个
2楼-- · 2019-03-04 15:36

Have you tried checking your web server's error log to see if PHP is throwing an error? That should help you identify the cause of the problem.

查看更多
登录 后发表回答