That will ensure `$read[$type]` is set even if there is no data and will break other tests.  The alternative would be to add another variable outside the loop.  Look at the thread for #9630 as to why I did it this way.