1--TEST--
2Test if socket_set_option() works, option:SO_ACCEPTFILTER
3--DESCRIPTION--
4-wrong params
5-set/get params comparison
6--EXTENSIONS--
7sockets
8--SKIPIF--
9<?php
10
11if (!defined("SO_ACCEPTFILTER")) {
12	die('SKIP on platforms not supporting SO_ACCEPTFILTER');
13}
14?>
15--FILE--
16<?php
17$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
18
19if (!$socket) {
20        die('Unable to create AF_INET socket [socket]');
21}
22try {
23	var_dump(socket_set_option( $socket, SOL_SOCKET, SO_ACCEPTFILTER, 1));
24} catch (\ValueError $e) {
25    echo $e->getMessage() . \PHP_EOL;
26}
27socket_listen($socket);
28var_dump(socket_set_option( $socket, SOL_SOCKET, SO_ACCEPTFILTER, "httpready"));
29var_dump(socket_get_option( $socket, SOL_SOCKET, SO_ACCEPTFILTER));
30socket_close($socket);
31?>
32--EXPECTF--
33Warning: socket_set_option(): Invalid filter argument type in %s on line %d
34bool(false)
35bool(true)
36array(1) {
37  ["af_name"]=>
38  string(9) "httpready"
39}
40