Die Klasse DateInvalidOperationException

(PHP 8 >= 8.3.0)

Einführung

Wird von DateTimeImmutable::sub() und DateTime::sub() geworfen, wenn versucht wird, eine nicht unterstützte Operation durchzuführen.

Ein Beispiel für eine solche nicht unterstützte Operation ist die Verwendung eines DateInterval-Objekts, das relative Zeitangaben wie next weekday darstellt, weil es nicht möglich ist, daraus eine logische Umkehranweisung zu konstruieren.

Klassenbeschreibung

classDateInvalidOperationExceptionextendsDateException {
protectedstring$message = "";
privatestring$string = "";
protectedint$code;
protectedstring$file = "";
protectedint$line;
privatearray$trace = [];
private?Throwable$previous = null;
publicException::__construct(string$message = "", int$code = 0, ?Throwable$previous = null)
finalpublicException::getCode(): int
finalpublicException::getLine(): int
}
To Top