phpday 2027 - Call for Papers

La classe StreamException

(PHP 8 >= 8.6.0)

Introduction

Une StreamException est lancée lorsqu'une opération sur un flux signale une erreur fatale à l'opération et que l'option de contexte de flux error_mode vaut StreamErrorMode::Exception.

Le message de l'exception est le message de la première erreur de l'opération. Toutes les erreurs de l'opération sont disponibles via StreamException::getErrors().

Note:

Le code de l'exception est un nombre interne qui peut changer entre les versions de PHP. Pour identifier l'erreur, il faut utiliser la propriété code des erreurs retournées par StreamException::getErrors().

Synopsis de la classe

class StreamException extends Exception {
/* 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 */
public function getErrors(): array
/* Méthodes héritées */
public function Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null)
final public function Exception::getMessage(): string
final public function Exception::getPrevious(): ?Throwable
final public function Exception::getCode(): int
final public function Exception::getFile(): string
final public function Exception::getLine(): int
final public function Exception::getTrace(): array
final public function Exception::getTraceAsString(): string
public function Exception::__toString(): string
private function Exception::__clone(): void
}

Sommaire

+add a note

User Contributed Notes

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