xref: /PHP-7.4/ext/standard/tests/network/bindto.phpt (revision dfb3a799)
1--TEST--
2Test invalid bindto
3--FILE--
4<?php
5$ctx = stream_context_create([
6    'socket' => [
7        'bindto' => 'invalid',
8    ],
9]);
10$fp = stream_socket_client(
11    'tcp://www.' . str_repeat('x', 100) . '.com:80',
12    $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $ctx
13);
14?>
15--EXPECTF--
16Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: %s in %s on line %d
17
18Warning: stream_socket_client(): unable to connect to tcp://www.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.com:80 (php_network_getaddresses: getaddrinfo failed: %s) in %s on line %d
19