bug74764.phpt 875 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #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);
  7. if ($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. $context = stream_context_create(
  16. array('socket' => array('bindto' => "0.0.0.0:0"))
  17. );
  18. $socket = stream_socket_client('tcp://localhost:1443', $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $context);
  19. ?>
  20. --EXPECTF--
  21. Warning: stream_socket_client(): Unable to connect to tcp://localhost:1443 (%s) in %s on line %d
  22. Warning: stream_socket_client(): Unable to connect to tcp://localhost:1443 (%s) in %s on line %d