PHP Function Reference

PHP streamWrapper stream_set_option() Method



The PHP streamWrapper::stream_set_option() method changes stream options. This method is called to set options on the stream.

Syntax

public streamWrapper::stream_set_option(option, arg1, arg2)

Parameters

option Required. It can be one of the following:
arg1 Required. If option is:
  • STREAM_OPTION_BLOCKING - Requested blocking mode (1 meaning block 0 not blocking).
  • STREAM_OPTION_READ_TIMEOUT - The timeout in seconds.
  • STREAM_OPTION_WRITE_BUFFER - Buffer mode (STREAM_BUFFER_NONE or STREAM_BUFFER_FULL).
arg2 Required. If option is:
  • STREAM_OPTION_BLOCKING - This option is not set.
  • STREAM_OPTION_READ_TIMEOUT - The timeout in microseconds.
  • STREAM_OPTION_WRITE_BUFFER - The requested buffer size.

Return Value

Returns true on success or false on failure. If option is not implemented, false is returned.


❮ PHP Streams Reference