summaryrefslogtreecommitdiff
path: root/ext/sockets/tests/socket_sendto_params.phpt
blob: c80c6a7ff1c5724d3e8af5c084b9d751911af846 (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_sendto - 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_sendto($s_c, "foo", -1, MSG_OOB, '127.0.0.1');
    } catch (\ValueError $e) {
        echo $e->getMessage() . \PHP_EOL;
    }
    socket_close($s_c);
?>
--EXPECT--
socket_sendto(): Argument #3 ($length) must be greater than or equal to 0