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 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?> 28--EXPECTF-- 29Warning: socket_create_pair(): Unable to create socket pair [%d]: %s not supported in %s on line %d 30bool(false) 31socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET 32socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM 33--CREDITS-- 34Till Klampaeckel, till@php.net 35Berlin TestFest 2009 36