|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53427 Stream array keys lost on stream_select
Submitted: 2010-11-30 13:30 UTC Modified: 2010-11-30 17:24 UTC
From: tudoadtedoadrb at gmail dot com Assigned: cataphract (profile)
Status: Closed Package: Streams related
PHP Version: 5.3.3 OS: Windows XP SP3
Private report: No CVE-ID: None
 [2010-11-30 13:30 UTC] tudoadtedoadrb at gmail dot com
When you pass a keyed array of streams into stream_select the keys are lost.

The behaviour I am seeing is similar to the socket_select bug 44197.

Test script:
$read["myindex"] = $mystream;
$write = NULL;
$except = NULL;


stream_select($read, $write, $except, 0);



Expected result:
Assuming $mystream changes status and there is data available for reading...

array(1) {
  resource(11) of type (stream)
array(1) {
  resource(11) of type (stream)

Actual result:
array(1) {
  resource(11) of type (stream)
array(1) {
  resource(11) of type (stream)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-30 13:38 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: cataphract
 [2010-11-30 17:22 UTC]
Automatic comment from SVN on behalf of cataphract
Log: - Implemented bug/request #53427 - stream_select doesn't preserve the
  keys. This cannot be backported to PHP 5.3 due to a BC break. See
  UPGRADING for more information.
 [2010-11-30 17:24 UTC]
-Status: Assigned +Status: Closed
 [2010-11-30 17:24 UTC]
Fixed in trunk, but cannot be backported to 5.3 in order not to break scripts that iterate the resulting arrays with for($i = 0; $i < count($fdset); $i++) { }.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 15:01:32 2024 UTC