现在要这样
include 'vendor/autoload.php';
if (DEBUG) {
$Whoops = new \Whoops\Run;
$title = "哎呀~不小心出错了";
$option = new \Whoops\Handler\PrettyPageHandler();
$option->setPageTitle($title);
$Whoops->pushHandler($option);
$Whoops->register();
ini_set('display_errors','On');
} else {
ini_set('display_errors','Off');
}