In my script, I set the include path (so another part of the application can include files too), check that a file exists, and include it.
However, after I set the include path,
$include_path = realpath('path/to/some/directory');
if(!is_string($include_path) || !is_dir($include_path))
// Bootstrap file is located at: "path/to/some/directory/bootstrap.php".
$bootstrap = 'bootstrap.php';
// Returns "bool(true)".
var_dump(file_exists($include_path . '/' . $bootstrap));
// Returns "bool(false)".
// This led me to believe that the include path was not being set properly.
// But it is. The next thing is what puzzles me.
// Not only are there no errors, but the file is included successfully!
file_exists does nothing more than say whether a file exists (and the script is allowed to know it exists), resolving the path relative to the cwd. It does not care about the include path.