1--TEST--
2socket_export_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_export_stream());
13var_dump(socket_export_stream(1, 2));
14var_dump(socket_export_stream(1));
15var_dump(socket_export_stream(new stdclass));
16var_dump(socket_export_stream(fopen(__FILE__, "rb")));
17var_dump(socket_export_stream(stream_socket_server("udp://127.0.0.1:58392", $errno, $errstr, STREAM_SERVER_BIND)));
18$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
19var_dump($s);
20socket_close($s);
21var_dump(socket_export_stream($s));
22
23
24echo "Done.";
25--EXPECTF--
26Warning: socket_export_stream() expects exactly 1 parameter, 0 given in %s on line %d
27NULL
28
29Warning: socket_export_stream() expects exactly 1 parameter, 2 given in %s on line %d
30NULL
31
32Warning: socket_export_stream() expects parameter 1 to be resource, integer given in %s on line %d
33NULL
34
35Warning: socket_export_stream() expects parameter 1 to be resource, object given in %s on line %d
36NULL
37
38Warning: socket_export_stream(): supplied resource is not a valid Socket resource in %s on line %d
39bool(false)
40
41Warning: socket_export_stream(): supplied resource is not a valid Socket resource in %s on line %d
42bool(false)
43resource(%d) of type (Socket)
44
45Warning: socket_export_stream(): supplied resource is not a valid Socket resource in %s on line %d
46bool(false)
47Done.
48
49