function asrhandler($file, $line, $code) { $msg = $this->errmessage(null, $code, $file, $line); print "\n***** Assertion failed: {$msg}\n"; } function errhandler($errno, $errstr, $errfile = null, $errline = null, $errcontext = null) { $msg = $this->errmessage($errno, $errstr, $errfile, $errline, $errcontext); print "\n***** {$msg}\n"; return true; } function shthandler() { echo str_repeat('-', 80), "\n"; if ($error = error_get_last()) { $this->errhandler($error['type'], $error['message'], $error['file'], $error['line']); exit("ABORTED\n"); } exit("THE END\n"); } function errmessage($errno, $errstr, $errfile = null, $errline = null, $errcontext = null) { isset($errno) and $errstr = "({$errno}): {$errstr}"; isset($errfile) and $errstr .= " in " . str_replace($this->cwd, '', $errfile); isset($errline) and $errstr .= " on {$errline}"; return $errstr; } } //---=====[ TEST ]=====---// AIIXTest::create()->start();