Also do not forget that those arrays are passed by reference and will be modified after stream_select() returns.
On exit, the arrays are modified to indicate which stream resource actually changed status.