title: Test whether a file exists anywhere in the include path
body: <p>I'm writing an autoload function and in the inner logic of it would like to test whether a certain file exists somewhere in the path prior to including it.</p>
  
  <p>This is the logic:</p>
  
  <p>If a file named <code>$className'.specialversion.php'</code> exists <em>anywhere</em> in the include path include it. Otherwise, let other autoloaders take care of including a file for this class.</p>
  
  <p>At the moment I just do:  <code>@include($calculatedPath);</code></p>
  
  <p>I'm not sure if it's a good approach to include and suppress the error. I would rather check if the file exists (somewhere in the include path) prior to including it.</p>
  
  <p>My question is:</p>
  
  <ul>
  <li>Can I test for existence of a file anywhere in the include path? </li>
  <li>Is it really problematic to do <code>@include($calculatedPath);</code>?</li>
  </ul>
  
  <p><strong>Edit</strong></p>
  
  <p>An important accent: I don't know where the file should be. I just want to know whether it exists in one of the directories in the include path. So I can't just do <code>file_exists()</code> or something like that.</p>