1--TEST--
2int set_file_buffer ( resource $stream , int $buffer );
3--CREDITS--
4marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
5--FILE--
6<?php
7
8class test_wrapper {
9
10  function stream_open($path, $mode, $openedpath) {
11    return true;
12  }
13
14  function stream_eof() {
15    return false;
16  }
17
18  function stream_write($data) {
19    echo "size: ", strlen($data), "\n";
20    return strlen($data);
21  }
22
23  function stream_set_option($option, $arg1, $arg2) {
24    echo "option: ", $option, ", ", $arg1, ", ", $arg2, "\n";
25    return false;
26  }
27}
28
29var_dump(stream_wrapper_register('test', 'test_wrapper'));
30$fd = fopen("test://foo","r");
31var_dump(set_file_buffer($fd, 50));
32var_dump(stream_set_chunk_size($fd, 42));
33var_dump(fwrite($fd, str_repeat('0', 70)));
34?>
35--CLEAN--
36<?php
37fclose($fd);
38unset($fd);
39?>
40--EXPECTF--
41bool(true)
42option: %d, %d, %d
43int(%i)
44int(%d)
45size: %d
46size: %d
47int(%d)
48