Skip to content

Commit a4ed171

Browse files
zobonikic
authored andcommitted
Accept null and 0 for microseconds argument in stream_select()
PHP 8.0 did not accept null for the usec argument, PHP 8.1 only accepts null. This means you can't easily write code compatible with both without triggering at least a deprecation warning. Drop the deprecation warning for now. Closes GH-7617.
1 parent d49f550 commit a4ed171

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

ext/standard/streamsfuncs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,7 @@ PHP_FUNCTION(stream_select)
790790
PHP_SAFE_MAX_FD(max_fd, max_set_count);
791791

792792
if (secnull && !usecnull) {
793-
if (usec == 0) {
794-
php_error_docref(NULL, E_DEPRECATED, "Argument #5 ($microseconds) should be null instead of 0 when argument #4 ($seconds) is null");
795-
} else {
793+
if (usec != 0) {
796794
zend_argument_value_error(5, "must be null when argument #4 ($seconds) is null");
797795
RETURN_THROWS();
798796
}

ext/standard/tests/streams/stream_select_null_usec.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ array(1) {
2727
resource(%d) of type (stream)
2828
}
2929

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

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

0 commit comments

Comments
 (0)