-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve keys in emulate_read_fd_set()
Keys are already preserved in the non-emulated case.
- Loading branch information
Showing
2 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
ext/standard/tests/streams/stream_select_preserve_keys.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--TEST-- | ||
Bug #53427 + emulate_read (stream_select does not preserve keys) | ||
--FILE-- | ||
<?php | ||
$read[1] = fopen(__FILE__, 'r'); | ||
$read['myindex'] = reset($read); | ||
$write = NULL; | ||
$except = NULL; | ||
|
||
var_dump($read); | ||
stream_select($read, $write, $except, 0); | ||
var_dump($read); | ||
fread(reset($read), 1); | ||
stream_select($read, $write, $except, 0); // // emulate_read | ||
var_dump($read); | ||
?> | ||
--EXPECTF-- | ||
array(2) { | ||
[1]=> | ||
resource(%d) of type (stream) | ||
["myindex"]=> | ||
resource(%d) of type (stream) | ||
} | ||
array(2) { | ||
[1]=> | ||
resource(%d) of type (stream) | ||
["myindex"]=> | ||
resource(%d) of type (stream) | ||
} | ||
array(2) { | ||
[1]=> | ||
resource(%d) of type (stream) | ||
["myindex"]=> | ||
resource(%d) of type (stream) | ||
} |