ParseError

(PHP 7, PHP 8)

简介

ParseError 当解析 PHP 代码时发生错误时抛出,比如当 eval()被调用出错时。

注意: 从 PHP 7.3.0 开始,ParseError 继承自 CompileError。之前的版本,则继承自 Error

类摘要

classParseErrorextendsCompileError {
protectedstring$message = "";
privatestring$string = "";
protectedint$code;
protectedstring$file = "";
protectedint$line;
privatearray$trace = [];
private?Throwable$previous = null;
publicError::__construct(string$message = "", int$code = 0, ?Throwable$previous = null)
finalpublicError::getCode(): int
finalpublicError::getFile(): string
finalpublicError::getLine(): int
finalpublicError::getTrace(): array
}
To Top