0

そのため、問題の解決策を見つけようとしてスタックオーバーフローを1回または約10億回経験しましたが、これまでのところ成功していません。彼が問題です。trigger_error を使用してエラー処理クラスのメソッドを呼び出しています。なんらかの理由で、定義された関数を呼び出さずにエラーがトリガーされます。助けてください。これが私のコードです

class runtime_errors
{
    public function __construct()
    {
        //  Calling required files
        include_once(ROOT."/inc/php/pac/browser_detect.php");
        include_once(ROOT."/inc/php/func/display_as.php");

        //  Setting needed class functions
        $this->browser      =   new BrowserDetection();
        $this->display_as   =   new display_as();

        //  if available we're going to set the query string
        if(isset($_SERVER['QUERY_STRING']))
            $this->query_string = $_SERVER['QUERY_STRING'];
        else
            $this->query_string = NULL;


        //  Setting this class and function as the error_handler, the & is important
        set_error_handler(array(&$this, 'log_error'));
    }

    public function log_error($errno, $errstr, $errfile, $errline)
    {
        echo 'am i working?';
    }
}
4

0 に答える 0