Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

疑问Dispatcher::setErrorHandler方法的回调参数的errno和Yaf_Application::getLastErrorNo不一致 #281

Open
fznply opened this issue May 22, 2016 · 1 comment

Comments

@fznply
Copy link

fznply commented May 22, 2016

测试发现Dispatcher::setErrorHandler方法的回调参数的errno和Yaf_Application::getLastErrorNo不一致,不知道是否为一个Bug。测试代码如下(可以直接命令行下执行):

<?php
function error_handler($errno, $errstr, $errfile, $errline, $errctx) {
   var_dump($errno == Yaf_Application::app()->getLastErrorNo());
   var_dump(Yaf_Application::app()->getLastErrorNo() == YAF_ERR_NOTFOUND_CONTROLLER);
}

$config = array(
  "application" => array(
   "directory" => "/tmp/notexists",
     "dispatcher" => array(
       "throwException" => 0, //trigger error instead of throw exception when error occure
      ),
  ),
);

$app = new Yaf_Application($config);
$app->getDispatcher()->setErrorHandler("error_handler", E_RECOVERABLE_ERROR);
$app->run();
@letwang
Copy link

letwang commented Jun 12, 2019

请使用最新版本即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants