Not exactly answering your question, but probably a better solution for checking whether an included file is actually part of your system is like thus:
Your main file, which is including other files has the following line:
define("SYSTEM_LOADED",true);
or use a different global variable.
Now in the included file test like thus:
if(!defined("SYSTEM_LOADED")) die("System is not loaded");
This approach puts testing in the included file, instead of the main file. The drawback of your approach is that for each file the file has to be opened, which is fine for one or a few files, but which will have an impact on your application after multiple files.