|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-02-14 23:11 UTC] jausions@php.net
[2008-02-14 23:27 UTC] jani@php.net
[2008-02-15 01:16 UTC] jausions@php.net
[2008-11-07 12:15 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 11 11:00:01 2025 UTC |
Description: ------------ The $options in stream_open() do not match in any way (or at least in any documented way) with the options passed to fopen() BTW: the documentation of fopen() and stream_open() doesn't make any mention of how the options are passed. So either a bug, or a major lack of documentation, either way, STREAM_REPORT_ERRORS cannot be checked for with the information available on the php.net site. Tested on: 5.1.4, 5.2.0, 5.2.3 and 5.2.5 on different Windows and Debian. Reproduce code: --------------- <?php class StreamTest { public function stream_open($path, $mode, $flags, &$opened_path) { echo 'Received: '.decbin($flags)."\r\n"; return false; } } stream_wrapper_register('test', 'StreamTest'); $flags = array(STREAM_USE_PATH, STREAM_REPORT_ERRORS); echo 'PHP v'.phpversion()."\r\n"; foreach ($flags as $flag) { echo 'Passed: '.decbin($flag)."\r\n"; $fp = @fopen('test://foo', 'r', $flag); } ?> Expected result: ---------------- PHP v5.1.4 Passed: 1 Received: 1 Passed: 1000 Received: 1000 Passed: 0 Received: 0 (or at least a OR on the STREAM_* constant and $flags in stream_open would return TRUE) Actual result: -------------- PHP v5.1.4 Passed: 1 Received: 101 Passed: 1000 Received: 101 Passed: 0 Received: 100