I think the correct way is to do:
if(file_exists(stream_resolve_include_path($filepath))){
include $filepath;
}
This is because the documentation says that stream_resolve_include_path
resolves the "filename against the include path according to the same rules as fopen()/include."
Some people suggested using is_file
or is_readable
but that´s not for the general use case because in the general use, if the file is blocked or unavailable for some reason after file_exists returns TRUE, that´s something you need to notice with a very ugly error message right on the final user´s face or otherwise you are open to unexpected and inexplicable behavior later with possible loss of data and things like that.