I think this code:if(file_exists(amodule.inc.php))     require_once(amodule.inc.php);  is misleading because of the use of the require_once.I think that - to keep the logic and wording in line - include_once would be appropriate (where there are a number of arguments to not use the if at all but I would like to concentrate on require vs include).As far as my understanding goes, the ONLY difference between require and include is that require has a consequence (halt) if the file does not exist vs. include proceeds with just a warning.But, in the example, if the file does not exists, the require_once code will not executed anyways. Therefore the require misleads from my point of view.From a superficial view, one could argue that the above code using require_once andif(file_exists(amodule.inc.php))     include_once(amodule.inc.php);are identical what, from my view, is not. Because:A rough analysis (like an automated check of a project) would throw a message, that amodule.inc.php is a vital project file, which the code shows, is not.Also, in a (not very likely) cas that between the execution of the if statement and the require_once statement, the file could be deleted. Then, even worse, the code would NOT execute like expected (to run without load) but give up.So, how would you guys out there argue?
Good or bad code? Or a secret reason?
php;coding style;readability