update page now

ValueError

(PHP 8)

Introduction

Une ValueError est lancée lorsque le type d'un argument est correct mais que sa valeur est incorrecte. Par exemple, si l'on passe un entier négatif alors que la fonction attend un entier positif, ou si l'on passe une chaîne ou un tableau vide alors que la fonction s'attend à ce qu'il ne soit pas vide.

Synopsis de la classe

class ValueError extends Error {
/* Propriétés héritées */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private ?Throwable $previous = null;
/* Méthodes héritées */
public function Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null)
final public function Error::getMessage(): string
final public function Error::getPrevious(): ?Throwable
final public function Error::getCode(): int
final public function Error::getFile(): string
final public function Error::getLine(): int
final public function Error::getTrace(): array
final public function Error::getTraceAsString(): string
public function Error::__toString(): string
private function Error::__clone(): void
}
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top