1--TEST--
2Test for socket_create_pair() with SOCK_CLOEXEC/SOCK_NONBLOCK
3--EXTENSIONS--
4sockets
5--SKIPIF--
6<?php
7if (!defined('SOCK_CLOEXEC')) die("skip SOCK_CLOEXEC");
8if (!defined('SOCK_NONBLOCK')) die("skip SOCK_NONBLOCK");
9?>
10--FILE--
11<?php
12$sockets = array();
13try {
14	socket_create_pair(AF_UNIX, 11 | SOCK_CLOEXEC, 0, $sockets);
15} catch (\ValueError $e) {
16	echo $e->getMessage() . PHP_EOL;
17}
18try {
19	socket_create_pair(AF_UNIX, 11 | SOCK_NONBLOCK, 0, $sockets);
20} catch (\ValueError $e) {
21	echo $e->getMessage() . PHP_EOL;
22}
23try {
24	socket_create_pair(AF_UNIX, 11 | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, $sockets);
25} catch (\ValueError $e) {
26	echo $e->getMessage() . PHP_EOL;
27}
28var_dump(socket_create_pair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, $sockets));
29?>
30--EXPECTF--
31socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A
32socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A
33socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A
34bool(true)
35