|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-01-11 03:14 UTC] grzegorz129 at gmail dot com
Description: ------------ Bug #53427 proposed stream_select() should preserve array keys, it was implemented in revision #305856 (http://svn.php.net/viewvc/?view=revision&revision=305856). However there's no documentation or changelog informations about changed behaviour. I believe it was first available since 5.4. Test script: --------------- $read = $except = null; $write = ["test" => fopen("php://stdout", "w")]; var_dump($write); stream_select($read, $write, $except, 0); var_dump($write); PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
I have confirmed stream_select() behave differently on 5.3.29 (tested on OS X). /******** TEST CODE ********/ $read = $except = null; $write = array("test" => fopen("php://stdout", "w")); var_dump($write); stream_select($read, $write, $except, 0); var_dump($write); /******** PHP 5.6.4 ********/ array(1) { ["test"]=> resource(5) of type (stream) } array(1) { ["test"]=> resource(5) of type (stream) } /******** PHP 5.3.29 ********/ array(1) { ["test"]=> resource(5) of type (stream) } array(1) { [0]=> resource(5) of type (stream) } Example of code which conforms to documentation of stream_select() but fails on 5.6.4: $read = $except = null; $write = array("test" => fopen("php://stdout", "w")); stream_select($read, $write, $except, 0); for($i = 0; $i < count($write); $i++) { var_dump($write[$i]); //"resource(n) of type (stream)" on 5.3.29, NULL on 5.6.4 }