summaryrefslogtreecommitdiff
path: root/ext/sockets/tests/socket_send_params.phpt
blob: 4c3f57729f59777841bd38354dfe4e44b645a5be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
ext/sockets - socket_send - test with incorrect parameters
--SKIPIF--
<?php
    if (!extension_loaded('sockets')) {
        die('skip sockets extension not available.');
    }
?>
--FILE--
<?php
    $s_c = socket_create_listen(0);
    try {
        $s_w = socket_send($s_c, "foo", -1, MSG_OOB);
    } catch (\ValueError $e) {
        echo $e->getMessage() . \PHP_EOL;
    }
    socket_close($s_c);
?>
--EXPECT--
socket_send(): Argument #3 ($len) must be greater than or equal to 0