PHP Include vs Require
PHP Require Statement
PHP Require and Include statements are identical to each other in working and functionality.
Require vs Include Statement
- While inclusion file doesn't exist on the given path require statement will produce a fatal error (E_COMPILE_ERROR) and stop the script.
- While inclusion file doesn't exist on the given path include statement will only produce a warning (E_WARNING) and the script will continue.
PHP Require_once Statement
PHP Require_once statement works same as PHP Include_once and require_once also follow (E_COMPILE_ERROR) condition during failure.