Throwable interface
(PHP 7, PHP 8)
소개
throwable은 오류 및 예외를 포함하여 throw 문을 통해 throw될 수 있는 모든 개체의 기본 인터페이스입니다.
메모: PHP 클래스는 Throwable 인터페이스를 직접 구현할 수 없으며 대신 Exception을 확장해야 합니다.
인터페이스 개요
interface Throwable {
/* Methods */
public getMessage(): string
public getCode(): int
public getFile(): string
public getLine(): int
public getTrace(): array
public getTraceAsString(): string
public getPrevious(): ?Throwable
abstract public __toString(): string
}
목차
- Throwable::getMessage — Gets the message
- Throwable::getCode — Gets the exception code
- Throwable::getFile — Gets the file in which the object was created
- Throwable::getLine — Gets the line on which the object was instantiated
- Throwable::getTrace — Gets the stack trace
- Throwable::getTraceAsString — Gets the stack trace as a string
- Throwable::getPrevious — Returns the previous Throwable
- Throwable::__toString — Gets a string representation of the thrown object