1--TEST--
2User-space streams: set_options returns "not implemented" for unhandled option types
3--FILE--
4<?php
5class test_wrapper {
6	function stream_open($path, $mode, $openedpath) {
7		return true;
8	}
9	function stream_eof() {
10		return false;
11	}
12	function stream_write($data) {
13		echo "size: ", strlen($data), "\n";
14		return strlen($data);
15	}
16	function stream_set_option($option, $arg1, $arg2) {
17		echo "option: ", $option, ", ", $arg1, ", ", $arg2, "\n";
18		return false;
19	}
20}
21
22var_dump(stream_wrapper_register('test', 'test_wrapper'));
23
24$fd = fopen("test://foo","r");
25
26var_dump(stream_set_write_buffer($fd, 50));
27var_dump(stream_set_chunk_size($fd, 42));
28
29var_dump(fwrite($fd, str_repeat('0', 70)));
30
31--EXPECT--
32bool(true)
33option: 3, 2, 50
34int(-1)
35int(8192)
36size: 42
37size: 28
38int(70)
39