Just a general programming question, I looked around the internet and couldn't find any "best practice" articles stating if one or the other is better.
When attempting to include user-editable files, I'm inclined to use "is_readable" because it checks for two things: existence, access. What I don't know is how well it works cross-platform. There was a bug before PHP 5.1 where this function would ignore ACLs.
I've seen code where people use if (file_exists($File) && is_readable($File)) and that just seems ridiculous and slow.
What would you recommend?
Comments
The PHP 5+ side of my brain says wrap the code in a try/catch since it's apparently not foolproof.
I always forget about the try/catch blocks. I'll have to do some tests right after I move my server to PHP 5 :)
Thanks for the reminder.