It does, unless file() leaves \n at the end of each array value. On second thought, I'm thinking it does.
Not sure how file() is faster than file_get_contents(), since it returns the same thing, except in an array instead of a string. I imagine the time it took to split into an array would lag it compared to just returning the data.
If you've benchmarked it, I'd love to see the results. I'll definitely wanna do this once I finish my benchmark extension to my framework, as this is relevant to my interests.
Results 1 to 14 of 14
Thread: [PHP] Simple Cache Class
Hybrid View
- 18 Nov. 2009 06:21am #1
- 18 Nov. 2009 06:24am #2
- Age
- 30
- Join Date
- Nov. 2009
- Location
- Anaheim, California
- Posts
- 1,065
- Reputation
- 99
- LCash
- 200.00
I had the data, it proved if I remember correctly to be about 1.3 ms faster. It wasn't a lot but that was the average.
I do not have the data because the classes I released are quite old (About 5 months,) and all the old data I had was gone.
To tell the truth I made the code so long ago that I am sure it could use some major updating. As for using it in a framework you will need to majorly change it to make it valuable.