Improved PHP open resource performance