Upcoming Critical PHP Security Release

The StreamError class

(PHP 8 >= 8.6.0)

Introduction

A StreamError object describes a single error reported by a stream operation. Instances are created by PHP and are returned by stream_last_errors() and StreamException::getErrors(), and passed to the error_handler stream context option.

Class synopsis

final readonly class StreamError {
/* Properties */
public int $severity;
}

Properties

code

The StreamErrorCode case identifying the kind of error.

message

The error message. This is the text of the diagnostic that is emitted with StreamErrorMode::Error, without the function name prefix.

wrapperName

The name of the stream wrapper that reported the error, for example plainfile for local files.

severity

The level the error is reported with in StreamErrorMode::Error mode, as one of the E_* constants, such as E_WARNING or E_NOTICE.

terminating

true if the error ended the operation and throws a StreamException in StreamErrorMode::Exception mode, false otherwise.

+add a note

User Contributed Notes

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