This seems to be a great alternative to file_exists.
if( file_exists(__DIR__.'/som-file.php') )
Goes way slower than:
if( stream_resolve_inlcude_path(__DIR__.'/som-file.php') !== false)
(PHP 5 >= 5.3.2)
stream_resolve_include_path — Resolve filename against the include path
Resolve filename against the include path according to the same rules as fopen()/include().
The filename to resolve.
Returns a string containing the resolved absolute filename, or FALSE on failure.
Example #1 stream_resolve_include_path() example
Basic usage example.
위 예제의 출력 예시:
stream_resolve_include_path() seems to cache it's output. After I renamed a file, I had to restart Apache for stream_resolve_include_path() to not return non-existing file name. This was on Windows.