Replace stream_get_line function