1--TEST-- 2ext/sockets - socket_connect - test with empty parameters 3--CREDITS-- 4Florian Anderiasch 5fa@php.net 6--SKIPIF-- 7<?php 8 if (!extension_loaded('sockets')) { 9 die('skip - sockets extension not available.'); 10 } 11?> 12--FILE-- 13<?php 14 $rand = rand(1,999); 15 $s_c = socket_create_listen(31330+$rand); 16 // wrong parameter count 17 $s_w = socket_connect(); 18 $s_w = socket_connect($s_c); 19 $s_w = socket_connect($s_c, '0.0.0.0'); 20 $s_w = socket_connect($s_c, '0.0.0.0', 31330+$rand); 21 22 socket_close($s_c); 23 24?> 25--EXPECTF-- 26 27Warning: socket_connect() expects at least 2 parameters, 0 given in %s on line %i 28 29Warning: socket_connect() expects at least 2 parameters, 1 given in %s on line %i 30 31Warning: socket_connect(): Socket of type AF_INET requires 3 arguments in %s on line %i 32 33Warning: socket_connect(): unable to connect [%i]: %a in %s on line %i 34