|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-03-20 10:46 UTC] paul dot smith at deepseaplc dot com
[2020-04-08 10:44 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Type: Bug
+Type: Documentation Problem
[2020-04-08 10:44 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 09:00:02 2025 UTC |
Description: ------------ stream_select() should always preserve keys of input arrays. It does so in the example for the first stream_select() call but then fails to do so in subsequent calls AFTER data has been read in. Test script: --------------- <?php $fp = fopen(__FILE__, "rb"); stream_set_blocking($fp, 0); $readfp = array("__fp" => $fp); $writefp = NULL; $exceptfp = NULL; $timeout = NULL; var_dump($readfp); $result = stream_select($readfp, $writefp, $exceptfp, $timeout); var_dump($readfp); $data = fread($fp, 1024); $readfp = array("__fp" => $fp); $writefp = NULL; $exceptfp = NULL; $timeout = NULL; var_dump($readfp); $result = stream_select($readfp, $writefp, $exceptfp, $timeout); var_dump($readfp); ?> Expected result: ---------------- array(1) { ["__fp"]=> resource(5) of type (stream) } array(1) { ["__fp"]=> resource(5) of type (stream) } array(1) { ["__fp"]=> resource(5) of type (stream) } array(1) { ["__fp"]=> resource(5) of type (stream) } Actual result: -------------- array(1) { ["__fp"]=> resource(5) of type (stream) } array(1) { ["__fp"]=> resource(5) of type (stream) } array(1) { ["__fp"]=> resource(5) of type (stream) } array(1) { [0]=> resource(5) of type (stream) }