@@ -12,6 +12,7 @@ $options_1 = array("sec" => 1, "usec" => "aaaaa");
1212$ options_2 = array ("sec " => new stdClass (), "usec " => "1 " );
1313$ options_3 = array ("l_onoff " => "aaaa " , "l_linger " => "1 " );
1414$ options_4 = array ("l_onoff " => "1 " , "l_linger " => []);
15+ $ options_5 = array ("l_onoff " => PHP_INT_MAX , "l_linger " => "1 " );
1516
1617try {
1718 socket_set_option ( $ socket , SOL_SOCKET , SO_RCVTIMEO , new stdClass );
4546} catch (\TypeError $ e ) {
4647 echo $ e ->getMessage () . PHP_EOL ;
4748}
49+ try {
50+ socket_set_option ( $ socket , SOL_SOCKET , SO_LINGER , $ options_5 );
51+ } catch (\ValueError $ e ) {
52+ echo $ e ->getMessage () . PHP_EOL ;
53+ }
4854?>
4955--EXPECT--
5056socket_set_option(): Argument #4 ($value) must be of type array, stdClass given
@@ -53,3 +59,4 @@ socket_set_option(): Argument #4 ($value) "sec" must be of type int, stdClass gi
5359socket_set_option(): Argument #4 ($value) must be of type array, string given
5460socket_set_option(): Argument #4 ($value) "l_onoff" must be of type int, string given
5561socket_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