1--TEST--
2Test parameter handling in socket_create_pair()
3--EXTENSIONS--
4sockets
5--SKIPIF--
6<?php
7if (substr(PHP_OS, 0, 3) != 'WIN') {
8    die('skip.. Not valid for non Windows');
9}
10?>
11--FILE--
12<?php
13
14var_dump(socket_create_pair(AF_INET, 0, 0, $sockets));
15
16try {
17    var_dump(socket_create_pair(31337, 0, 0, $sockets));
18} catch (\ValueError $e) {
19    echo $e->getMessage() . \PHP_EOL;
20}
21
22try {
23    var_dump(socket_create_pair(AF_INET, 31337, 0, $sockets));
24} catch (\ValueError $e) {
25    echo $e->getMessage() . \PHP_EOL;
26}
27?>
28--EXPECT--
29bool(true)
30socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET
31socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM
32--CREDITS--
33Till Klampaeckel, till@php.net
34Berlin TestFest 2009
35