Bug #53427 [Asn->Csd]: Stream array keys lost on stream_select

From: Date: Tue, 30 Nov 2010 16:24:21 +0000
Subject: Bug #53427 [Asn->Csd]: Stream array keys lost on stream_select
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156589@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53427&edit=1

 ID:                 53427
 Updated by:         cataphract@php.net
 Reported by:        tudoadtedoadrb at gmail dot com
 Summary:            Stream array keys lost on stream_select
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Streams related
 Operating System:   Windows XP SP3
 PHP Version:        5.3.3
 Assigned To:        cataphract
 Block user comment: N
 Private report:     N

 New Comment:

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++) { }.


Previous Comments:
------------------------------------------------------------------------
[2010-11-30 17:22:50] cataphract@php.net

Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=305856
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 13:30:15] tudoadtedoadrb at gmail dot com

Description:
------------
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:
---------------
<?php
$read["myindex"] = $mystream;
$write = NULL;
$except = NULL;

var_dump($read);

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

var_dump($read);

?> 


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

array(1) {
  ["myindex"]=>
  resource(11) of type (stream)
}
array(1) {
  ["myindex"]=>
  resource(11) of type (stream)
}

Actual result:
--------------
array(1) {
  ["myindex"]=>
  resource(11) of type (stream)
}
array(1) {
  [0]=>
  resource(11) of type (stream)
}


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53427&edit=1


Thread (3 messages)

« previous php.bugs (#156589) next »