Article About php Function Stream_Context_Get_Params
Article about php function stream_context_get_params
This is an article about the php function stream_context_get_params which was introduced in PHP Version 5.3. It provides a mechanism for obtaining information about parameters and options from the context object. This function can be used to assist in debugging or when a developer is attempting to decipher what has been passed into the function from an argument.
The stream_context_get_params() function accepts a parameter array and return an associative array of all context options and parameters. This allows developers to inspect the parameters and options of a stream context at runtime and determine why a particular error or warning has occurred.
Stream contexts are object wrappers which act as the interface between a streamable protocol or encoding and the stream's hardware implementation. Typically, a streamable protocol will provide the ability to fread() and fwrite(), and it may also be able to fseek() to an arbitrary position within its stream. A stream context will provide additional functionality such as the ability to encrypt or truncate data and to support multiple protocols or encodings.
The stream_context_get_params() functions can be used to read and modify the status of a stream context's arrays of read, write, and except. The stream_context_get_params() methods allow the use of a timeout value which specifies how long the function will wait to poll for any streams that have changed their status, before returning. Be aware that if the timeout value is set to zero, your script will poll the status of all streams every second and consume large amounts of CPU resources. Using a small timeout value is much more reasonable, and will help reduce the load on your system.