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, sau
FALSE în cazul eșecului.
Example #1 stream_resolve_include_path() example
Basic usage example.
Exemplul de mai sus va afișa ceva similar cu:
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.