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--EXPECT-- 31bool(true) 32option: 3, 2, 50 33int(-1) 34int(8192) 35size: 42 36size: 28 37int(70) 38