1--TEST--
2Test parameter handling in socket_create_pair()
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) != 'WIN') {
6    die('skip.. Not valid for non Windows');
7}
8if (!extension_loaded('sockets')) {
9    die('SKIP The sockets extension is not loaded.');
10}
11--FILE--
12<?php
13
14var_dump(socket_create_pair(AF_INET, null, null, $sockets));
15
16try {
17    var_dump(socket_create_pair(31337, null, null, $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