1--TEST--
2Test if socket_set_option() works, option:SO_ATTACH_REUSEPORT_CBPF
3--EXTENSIONS--
4sockets
5--SKIPIF--
6<?php
7
8if (!defined("SO_ATTACH_REUSEPORT_CBPF")) {
9	die('SKIP on platforms not supporting SO_ATTACH_REUSEPORT_CBPF');
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}
19var_dump(socket_set_option( $socket, SOL_SOCKET, SO_REUSEADDR, true));
20var_dump(socket_set_option( $socket, SOL_SOCKET, SO_REUSEPORT, true));
21var_dump(socket_set_option( $socket, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, SKF_AD_CPU));
22var_dump(socket_bind($socket, '0.0.0.0'));
23socket_listen($socket);
24socket_close($socket);
25?>
26--EXPECT--
27bool(true)
28bool(true)
29bool(true)
30bool(true)
31