1--TEST--
2Test if socket_set_option() works, option:TCP_FUNCTION_BLK
3--EXTENSIONS--
4sockets
5--SKIPIF--
6<?php
7
8if (!defined("TCP_FUNCTION_BLK")) {
9	die('SKIP on platforms not supporting TCP_FUNCTION_BLK');
10}
11?>
12--FILE--
13<?php
14$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
15
16if (!$socket) {
17        die('Unable to create AF_INET socket [socket]');
18}
19socket_set_option( $socket, SOL_TCP, TCP_FUNCTION_BLK, "nochancetoexist");
20// TCP/RACK and other alternate stacks are not present by default, at least `freebsd` is.
21var_dump(socket_set_option( $socket, SOL_TCP, TCP_FUNCTION_BLK, "freebsd"));
22var_dump(socket_get_option( $socket, SOL_TCP, TCP_FUNCTION_BLK));
23socket_close($socket);
24?>
25--EXPECTF--
26Warning: socket_set_option(): Unable to set socket option [2]: No such file or directory in %s on line %d
27bool(true)
28array(2) {
29  ["function_set_name"]=>
30  string(7) "freebsd"
31  ["pcbcnt"]=>
32  int(%d)
33}
34