@@ -12,6 +12,7 @@ $options_1 = array("sec" => 1, "usec" => "aaaaa");
12
12
$ options_2 = array ("sec " => new stdClass (), "usec " => "1 " );
13
13
$ options_3 = array ("l_onoff " => "aaaa " , "l_linger " => "1 " );
14
14
$ options_4 = array ("l_onoff " => "1 " , "l_linger " => []);
15
+ $ options_5 = array ("l_onoff " => PHP_INT_MAX , "l_linger " => "1 " );
15
16
16
17
try {
17
18
socket_set_option ( $ socket , SOL_SOCKET , SO_RCVTIMEO , new stdClass );
@@ -45,11 +46,17 @@ try {
45
46
} catch (\TypeError $ e ) {
46
47
echo $ e ->getMessage () . PHP_EOL ;
47
48
}
49
+ try {
50
+ socket_set_option ( $ socket , SOL_SOCKET , SO_LINGER , $ options_5 );
51
+ } catch (\ValueError $ e ) {
52
+ echo $ e ->getMessage () . PHP_EOL ;
53
+ }
48
54
?>
49
- --EXPECT --
55
+ --EXPECTF --
50
56
socket_set_option(): Argument #4 ($value) must be of type array, stdClass given
51
57
socket_set_option(): Argument #4 ($value) "usec" must be of type int, string given
52
58
socket_set_option(): Argument #4 ($value) "sec" must be of type int, stdClass given
53
59
socket_set_option(): Argument #4 ($value) must be of type array, string given
54
60
socket_set_option(): Argument #4 ($value) "l_onoff" must be of type int, string given
55
61
socket_set_option(): Argument #4 ($value) "l_linger" must be of type int, array given
62
+ socket_set_option(): Argument #4 ($value) "l_onoff" must be between 0 and %d
0 commit comments