--TEST-- Testing stream_get_meta_data() "unread_bytes" field on a udp socket --FILE-- --EXPECTF-- Write some data: array(7) { ["timed_out"]=> bool(false) ["blocked"]=> bool(true) ["eof"]=> bool(false) ["stream_type"]=> string(%d) "tcp_socke%s" ["mode"]=> string(2) "r+" ["unread_bytes"]=> int(0) ["seekable"]=> bool(false) } Read a line from the client, causing data to be buffered: array(7) { ["timed_out"]=> bool(false) ["blocked"]=> bool(true) ["eof"]=> bool(false) ["stream_type"]=> string(%d) "tcp_socke%s" ["mode"]=> string(2) "r+" ["unread_bytes"]=> int(15) ["seekable"]=> bool(false) } Read 3 bytes of data from the client: array(7) { ["timed_out"]=> bool(false) ["blocked"]=> bool(true) ["eof"]=> bool(false) ["stream_type"]=> string(%d) "tcp_socke%s" ["mode"]=> string(2) "r+" ["unread_bytes"]=> int(12) ["seekable"]=> bool(false) } Close the server side socket and read the remaining data from the client: array(7) { ["timed_out"]=> bool(false) ["blocked"]=> bool(true) ["eof"]=> bool(true) ["stream_type"]=> string(%d) "tcp_socke%s" ["mode"]=> string(2) "r+" ["unread_bytes"]=> int(0) ["seekable"]=> bool(false) }