mirror of
https://github.com/php/php-src.git
synced 2026-04-24 00:18:23 +02:00
a4ed17167c
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.
36 lines
729 B
PHP
36 lines
729 B
PHP
--TEST--
|
|
stream_select allows null for microsecond timeout if timeout is null
|
|
--FILE--
|
|
<?php
|
|
|
|
$read = [fopen(__FILE__, 'r')];
|
|
$write = null;
|
|
$except = null;
|
|
|
|
error_reporting(-1);
|
|
set_error_handler(function ($errno, $errstr) {
|
|
print $errno . " " . $errstr . "\n";
|
|
});
|
|
|
|
stream_select($read, $write, $except, null, null);
|
|
var_dump($read);
|
|
|
|
print "\n";
|
|
|
|
stream_select($read, $write, $except, null, 0);
|
|
|
|
stream_select($read, $write, $except, null, 1);
|
|
?>
|
|
--EXPECTF--
|
|
array(1) {
|
|
[0]=>
|
|
resource(%d) of type (stream)
|
|
}
|
|
|
|
|
|
Fatal error: Uncaught ValueError: stream_select(): Argument #5 ($microseconds) must be null when argument #4 ($seconds) is null in %s
|
|
Stack trace:
|
|
#0 %s stream_select(Array, NULL, NULL, NULL, 1)
|
|
#1 {main}
|
|
%s
|