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

 ID:                 53427
 Updated by:         cataphr...@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] cataphr...@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

Reply via email to