|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-09-15 12:52 UTC] cf0hay at gmail dot com
[2018-05-05 18:36 UTC] requinix@php.net
-Status: Open
+Status: Wont fix
-Package: Feature/Change Request
+Package: *General Issues
[2018-05-05 18:36 UTC] requinix@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 21:00:01 2025 UTC |
Description: ------------ When trying, for example, to do : <?php $socket = stream_socket_server('tcp://0.0.0.0', $errno, $errstr); var_dump($errstr); ?> We get the following output : Warning: stream_socket_server(): unable to connect to tcp://0.0.0.0 (Failed to parse address "0.0.0.0") in /home/magicaltux/- on line 2 string(33) "Failed to parse address "0.0.0.0"" Expected result would be to have no port passed to bind, and thru having a random port allocated by the operating system (that we would later retrieve with stream_socket_get_name). In socket_bind, the port is also optionnal. It's still possible to get a random port by using ":0" but the no-port behaviour would be great too (and probably not too hard to implement). Reproduce code: --------------- <?php $socket = stream_socket_server('tcp://0.0.0.0', $errno, $errstr); var_dump($errstr); ?> Expected result: ---------------- string(0) "" Actual result: -------------- Warning: stream_socket_server(): unable to connect to tcp://0.0.0.0 (Failed to parse address "0.0.0.0") in /home/magicaltux/- on line 2 string(33) "Failed to parse address "0.0.0.0""