The difference between 4 load statements
The difference between include and require :
Include loading the file fails (that is, the file is not found), report a "prompt error", and then continue to execute the subsequent code;
Requre The file fails to load, an error occurs and the execution is immediately terminated.
Typically,require is used in programs where subsequent code depends on the loaded file.
The difference between include_once and require_once :
differences from include and require :
The difference between include and include_once :
Include loaded files do not determine whether to repeat, as long as there is an include statement, will be loaded once-that is, it may cause a duplicate loading.
Include_once loaded files will have an internal judging mechanism whether the "previous code" has been loaded, and if loaded, no longer loaded.
The difference between require and require_once :
Differences with include and include_once .
The function of The return statement in the loaded file
1, a load statement, if the load succeeds, there is actually a return value of 1, if the load fails, then the return is false.
(although we usually do not use the return value).
However, if there is a return statement loaded into the file , there is another mechanism and effect at this point:
2,thereturn statement at this point is to terminate the loading process-the return statement's subsequent loaded file code is no longer loaded.
The result of the operation is:
3, The return statement can also be used to return a data when loading a file in the form:return XX data;
The result of the operation is:
PHP4 the difference between a load statement