From:             darrel dot opry at gmail dot com
Operating system: Linux
PHP version:      5.2.5
PHP Bug Type:     Sockets related
Bug description:  socket array keys lost on socket_select

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 bug report at http://bugs.php.net/?id=44197&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44197&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44197&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44197&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44197&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44197&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44197&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44197&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44197&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44197&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44197&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44197&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44197&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44197&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44197&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44197&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44197&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44197&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44197&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44197&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44197&r=mysqlcfg

Reply via email to