Bug #78375 [Opn->Ver]: stream_set_option method of stream wrapper is now called inside require()
| From: | cmb@php.net | Date: | Mon, 05 Aug 2019 16:00:47 +0000 |
| Subject: | Bug #78375 [Opn->Ver]: stream_set_option method of stream wrapper is now called inside require() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222093@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78375&edit=1
ID: 78375
Updated by: cmb@php.net
Reported by: mail at ciaranmcnulty dot com
Summary: stream_set_option method of stream wrapper is now
called inside require()
-Status: Open
+Status: Verified
Type: Bug
Package: Streams related
Operating System: Debian Slim (docker)
PHP Version: 7.4.0beta1
Block user comment: N
Private report: N
New Comment:
Confirmed: <https://3v4l.org/QjgOW>
Previous Comments:
------------------------------------------------------------------------
[2019-08-05 15:55:07] mail at ciaranmcnulty dot com
Description:
------------
Any
require that is done through a protocol with a wrapper, now calls
stream_set_option on the stream wrapper.
Because a stream wrapper doesn't have an interface, a class could not yet implement this method
and therefore cause a fatal error.
The option being set is not one of the listed constants (STREAM_OPTION_BLOCKING,
STREAM_OPTION_READ_TIMEOUT, STREAM_OPTION_WRITE_BUFFER), rather it is integer 2
Test script:
---------------
class StreamWrapper
{
public function stream_open($path, $mode, $options, &$opened_path)
{
return true;
}
public function stream_stat() { return stat(__FILE__); }
public function stream_read($count) { return ''; }
public function stream_eof() { return true; }
}
stream_wrapper_register('test', StreamWrapper::class);
require_once('test://foo');
Expected result:
----------------
No output
Actual result:
--------------
Warning: require_once(): StreamWrapper::stream_set_option is not implemented!
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78375&edit=1