私はこのエラーが表示されます。set_error_handler()は無効なコールバックを受け取りますか?
set_error_handler() expects the argument (userErrorAdvice) to be a valid callback
trait userErrorAdviceTrait
{
public function userErrorAdvice()
{
$error = error_get_last();
$_SESSION['errorStore'] = $error;
$errorMessage = "No file exists for the PageController";
if (strstr($error['message'], "No file exists for the PageController class"))
{
header('Location: http://192.171.127.39/~louis/errorAdvicePage.php?errorType=NoPageControllerError');
exit;
}
}
public function setUserErrorAdvice()
{
set_error_handler("userErrorAdvice");
}
}
use userErrorAdviceTrait;
public static function makePageController($pageName)
{
//self::shutDownFunction();
//self::shutdown_function();
self::setUserErrorAdvice();
//Rest of code ....
これは詳細を書くために私を強制的にですが、私は言うことは何も残っていません。
これは100%ではありませんが、範囲の問題ではないかと推測しています。 'set_error_handler'は特定のクラスではなく、スクリプト全体であるため、' userErrorAdvice() 'というグローバル関数を探しています。それは、それがそのエラーをスローすることがわからないので。 – Mike
'http://192.171.127./~louis [etc]'は有効なURLのようには見えません。 – Mike
nvm URLはstackoverflowでどのように入力したかのエラーです。調整します。 –