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