--TEST-- Testing stream_get_meta_data() "unread_bytes" field --FILE-- --EXPECTF-- Write some data to the file: array(9) { ["wrapper_type"]=> string(9) "plainfile" ["stream_type"]=> string(5) "STDIO" ["mode"]=> string(2) "w+" ["unread_bytes"]=> int(0) ["seekable"]=> bool(true) ["uri"]=> string(%i) "%s.tmp" ["timed_out"]=> bool(false) ["blocked"]=> bool(true) ["eof"]=> bool(false) } Read a line of the file, causing data to be buffered: string(15) "a line of data " array(9) { ["wrapper_type"]=> string(9) "plainfile" ["stream_type"]=> string(5) "STDIO" ["mode"]=> string(2) "w+" ["unread_bytes"]=> int(285) ["seekable"]=> bool(true) ["uri"]=> string(%i) "%s.tmp" ["timed_out"]=> bool(false) ["blocked"]=> bool(true) ["eof"]=> bool(false) } Read 20 bytes from the file: array(9) { ["wrapper_type"]=> string(9) "plainfile" ["stream_type"]=> string(5) "STDIO" ["mode"]=> string(2) "w+" ["unread_bytes"]=> int(265) ["seekable"]=> bool(true) ["uri"]=> string(%i) "%s.tmp" ["timed_out"]=> bool(false) ["blocked"]=> bool(true) ["eof"]=> bool(false) } Read entire file: array(9) { ["wrapper_type"]=> string(9) "plainfile" ["stream_type"]=> string(5) "STDIO" ["mode"]=> string(2) "w+" ["unread_bytes"]=> int(0) ["seekable"]=> bool(true) ["uri"]=> string(%i) "%s.tmp" ["timed_out"]=> bool(false) ["blocked"]=> bool(true) ["eof"]=> bool(true) }