Skip to content

Accept null and 0 for microseconds argument in stream_select() #7617

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ext/standard/streamsfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,7 @@ PHP_FUNCTION(stream_select)
PHP_SAFE_MAX_FD(max_fd, max_set_count);

if (secnull && !usecnull) {
if (usec == 0) {
php_error_docref(NULL, E_DEPRECATED, "Argument #5 ($microseconds) should be null instead of 0 when argument #4 ($seconds) is null");
} else {
if (usec != 0) {
zend_argument_value_error(5, "must be null when argument #4 ($seconds) is null");
RETURN_THROWS();
}
Expand Down
1 change: 0 additions & 1 deletion ext/standard/tests/streams/stream_select_null_usec.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ array(1) {
resource(%d) of type (stream)
}

8192 stream_select(): Argument #5 ($microseconds) should be null instead of 0 when argument #4 ($seconds) is null

Fatal error: Uncaught ValueError: stream_select(): Argument #5 ($microseconds) must be null when argument #4 ($seconds) is null in %s
Stack trace:
Expand Down