Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove requirement to suppress warning #125

Closed
wants to merge 1 commit into from

Commits on Oct 23, 2020

  1. Remove requirement to suppress warning

    In order to not waste resources on suppressing an E_WARNING and to accommodate debuggers that may ignore the suppression, we can use `stream_select` to check to see if there is a read available before we attempt to accept the socket.
    
    From the php docs on the read parameter: `The sockets listed in the read array will be watched to see if characters become available for reading (more precisely, to see if a read will not block - in particular, a socket resource is also ready on end-of-file, in which case a socket_read() will return a zero length string).`
    
    The warning about using `===` for comparisons is when checking for an error, in this case, we really only want to continue if we have a truthy value. The function returns `FALSE` for errors OR the (int) `number of socket resources contained in the modified arrays`.
    duckboy81 committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    1f13be0 View commit details
    Browse the repository at this point in the history