(PHP 8 >= 8.6.0)
A StreamException is thrown when a stream
operation reports a terminating error and the
error_mode
stream context option is set to StreamErrorMode::Exception.
The exception message is the message of the first error of the operation. All errors of the operation are available from StreamException::getErrors().
Note:
The exception code is an internal number that may change between PHP versions. To identify the error, use the code property of the errors returned by StreamException::getErrors().