1--TEST--
2Bug #74764 IPv6 bindto fails with stream_socket_client()
3--SKIPIF--
4<?php
5/* following copied straight from the tcp6loop.phpt */
6@stream_socket_client('tcp://[::1]:0', $errno);
7if ($errno != 111) die('skip IPv6 not supported.');
8?>
9--FILE--
10<?php
11$context = stream_context_create(
12    ['socket' => array('bindto' => "[::]:0")]
13    );
14    $socket = stream_socket_client('tcp://localhost:1443', $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $context);
15
16$context = stream_context_create(
17    array('socket' => array('bindto' => "0.0.0.0:0"))
18    );
19    $socket = stream_socket_client('tcp://localhost:1443', $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $context);
20?>
21--EXPECTF--
22Warning: stream_socket_client(): unable to connect to tcp://localhost:1443 (%s) in %s on line %d
23
24Warning: stream_socket_client(): unable to connect to tcp://localhost:1443 (%s) in %s on line %d
25