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
The filename to resolve.
Returns a string containing the resolved absolute filename, 或者在失败时返回
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.