#44197 [Csd->Tbd]: socket array keys lost on socket_select
| From: | philip@php.net | Date: | Sat, 27 Dec 2008 05:46:16 +0000 |
| Subject: | #44197 [Csd->Tbd]: socket array keys lost on socket_select | ||
| References: | 1 | Groups: | php.bugs php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-1674@lists.php.net to get a copy of this message | ||
ID: 44197
Updated by: philip@php.net
Reported By: darrel dot opry at gmail dot com
-Status: Closed
+Status: To be documented
Bug Type: Sockets related
Operating System: Linux
PHP Version: 5.2.5
New Comment:
What exactly is the change in behaviour?
Previous Comments:
------------------------------------------------------------------------
[2008-07-15 13:01:17] jani@php.net
Note: This fix is in PHP 5.3.0 and upwards as it changes the
behaviour..
------------------------------------------------------------------------
[2008-02-21 02:35:21] felipe@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2008-02-21 00:18:37] darrel dot opry at gmail dot com
Description:
------------
When you pass a keyed array of sockets into socket_select the keys are
lost.
Reproduce code:
---------------
$clients = array();
$listener = socket_create_listen(9999);
$clients[uniqid()] = socket_accept($listener);
$read = $clients;
print_r($read);
socket_select($read, $w = NULL, $e = NULL, NULL);
print_r($read);
socket_shutdown($listener);
socket_close($listener);
Expected result:
----------------
to test:
telnet localhost 9999
enter text, hit enter.
I expect the second print_r($read) to have the same key as the first
print_r($read).
Actual result:
--------------
Array
(
[47bcc1d71874d] => Resource id #5
)
Array
(
[0] => Resource id #5
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44197&edit=1