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--FILE--
11<?php
12
13var_dump(socket_create_pair(AF_INET, 0, 0, $sockets));
14
15try {
16    var_dump(socket_create_pair(31337, 0, 0, $sockets));
17} catch (\ValueError $e) {
18    echo $e->getMessage() . \PHP_EOL;
19}
20
21try {
22    var_dump(socket_create_pair(AF_INET, 31337, 0, $sockets));
23} catch (\ValueError $e) {
24    echo $e->getMessage() . \PHP_EOL;
25}
26?>
27--EXPECT--
28bool(true)
29socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET
30socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM
31--CREDITS--
32Till Klampaeckel, till@php.net
33Berlin TestFest 2009
34