phpday 2027 - Call for Papers

La clase StreamException

(PHP 8 >= 8.6.0)

Introducción

Se lanza una StreamException cuando una operación de flujo notifica un error terminante y la opción de contexto de flujo error_mode está establecida en StreamErrorMode::Exception.

El mensaje de la excepción es el mensaje del primer error de la operación. Todos los errores de la operación están disponibles mediante StreamException::getErrors().

Nota:

El código de la excepción es un número interno que puede cambiar entre versiones de PHP. Para identificar el error, utilice la propiedad code de los errores devueltos por StreamException::getErrors().

Sinopsis de la clase

class StreamException extends Exception {
/* Propiedades heredadas */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private ?Throwable $previous = null;
/* Métodos */
public function getErrors(): array
/* Métodos heredados */
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
}

Tabla de contenidos

+add a note

User Contributed Notes

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