1--TEST--
2socket_import_stream: Bad arguments
3--SKIPIF--
4<?php
5if (!extension_loaded('sockets')) {
6	die('SKIP sockets extension not available.');
7}
8
9--FILE--
10<?php
11
12var_dump(socket_import_stream());
13var_dump(socket_import_stream(1, 2));
14var_dump(socket_import_stream(1));
15var_dump(socket_import_stream(new stdclass));
16var_dump(socket_import_stream(fopen(__FILE__, "rb")));
17var_dump(socket_import_stream(socket_create(AF_INET, SOCK_DGRAM, SOL_UDP)));
18$s = stream_socket_server("udp://127.0.0.1:58392", $errno, $errstr, STREAM_SERVER_BIND);
19var_dump($s);
20var_dump(fclose($s));
21var_dump(socket_import_stream($s));
22
23
24echo "Done.";
25--EXPECTF--
26Warning: socket_import_stream() expects exactly 1 parameter, 0 given in %s on line %d
27NULL
28
29Warning: socket_import_stream() expects exactly 1 parameter, 2 given in %s on line %d
30NULL
31
32Warning: socket_import_stream() expects parameter 1 to be resource, integer given in %s on line %d
33NULL
34
35Warning: socket_import_stream() expects parameter 1 to be resource, object given in %s on line %d
36NULL
37
38Warning: socket_import_stream(): cannot represent a stream of type STDIO as a Socket Descriptor in %s on line %d
39bool(false)
40
41Warning: socket_import_stream(): supplied resource is not a valid stream resource in %s on line %d
42bool(false)
43resource(%d) of type (stream)
44bool(true)
45
46Warning: socket_import_stream(): supplied resource is not a valid stream resource in %s on line %d
47bool(false)
48Done.
49
50