if PHP < 5.4 use own implementation of stream_get_line()