File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
sockets /
tests /
socket_import_stream-2.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue May 29 12:34:42 2012 UTC (12 years, 3 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
HEAD
php 5.4.3+patches
--TEST--
socket_import_stream: Bad arguments
--SKIPIF--
<?php
if (!extension_loaded('sockets')) {
die('SKIP sockets extension not available.');
}
--FILE--
<?php
var_dump(socket_import_stream());
var_dump(socket_import_stream(1, 2));
var_dump(socket_import_stream(1));
var_dump(socket_import_stream(new stdclass));
var_dump(socket_import_stream(fopen(__FILE__, "rb")));
var_dump(socket_import_stream(socket_create(AF_INET, SOCK_DGRAM, SOL_UDP)));
$s = stream_socket_server("udp://127.0.0.1:58392", $errno, $errstr, STREAM_SERVER_BIND);
var_dump($s);
var_dump(fclose($s));
var_dump(socket_import_stream($s));
echo "Done.";
--EXPECTF--
Warning: socket_import_stream() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: socket_import_stream() expects exactly 1 parameter, 2 given in %s on line %d
NULL
Warning: socket_import_stream() expects parameter 1 to be resource, integer given in %s on line %d
NULL
Warning: socket_import_stream() expects parameter 1 to be resource, object given in %s on line %d
NULL
Warning: socket_import_stream(): cannot represent a stream of type STDIO as a Socket Descriptor in %s on line %d
bool(false)
Warning: socket_import_stream(): supplied resource is not a valid stream resource in %s on line %d
bool(false)
resource(%d) of type (stream)
bool(true)
Warning: socket_import_stream(): %d is not a valid stream resource in %s on line %d
bool(false)
Done.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>