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