socket array keys lost on socket_select
| Bug #44197 | socket array keys lost on socket_select | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2008-02-21 00:18 UTC | Modified: | 2012-03-23 17:27 UTC |
|
||||||||||
| From: | darrel dot opry at gmail dot com | Assigned: | nikic (profile) | |||||||||||
| Status: | Closed | Package: | Sockets related | |||||||||||
| PHP Version: | 5.2.5 | OS: | Linux | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2008-02-21 00:18 UTC] 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
)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2008-02-21 02:35 UTC] felipe@php.net
[2008-07-15 13:01 UTC] jani@php.net
[2008-12-27 05:46 UTC] philip@php.net
[2012-03-23 17:27 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic