|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2013-05-25 17:09 UTC] rdlowrey at gmail dot com
  [2014-04-02 14:00 UTC] mike@php.net
 
-Status: Open
+Status: Not a bug
  [2014-04-02 14:00 UTC] mike@php.net
  [2014-04-02 14:12 UTC] rdlowrey@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 12:00:01 2025 UTC | 
Description: ------------ Streams of type php://memory cannot be represented as selectable descriptors where stream_select() is concerned. Attempting to do so will (rightly) trigger an E_WARNING along the lines of "Warning: stream_select(): cannot represent a stream of type MEMORY as a select()able descriptor in ..." I would expect streams of type php://temp to behave the same way. However, this is not the case. Instead, php://temp streams are immediately readable (but do not evaluate to TRUE for feof($stream). These streams should either (1) trigger an error similar to that of php://memory or (2) not be represented as readable by stream_select(). Test script: --------------- $stream = fopen('php://memory', 'r+'); $r = array($stream); $w = $e = NULL; stream_select($r, $w, $e, 0); // E_WARNING (as expected) $stream = fopen('php://temp', 'r'); $r = array($stream); $w = $e = NULL; if (stream_select($r, $w, $e, 0)) { var_dump(feof($stream)); // this isn't readable and should never be called but it results in bool(false) } Expected result: ---------------- The test script should trigger two warnings and neither stream should report as readable. Actual result: -------------- php://temp streams do not trigger an error when used with stream_select() and are immediately reported as readable.