Quick Answer
include: shows warning if file not found, script continues. require: shows fatal error if file not found, script stops. Use require for files that are essential (DB config, core functions) - the app can't run without them. Use include for optional files. Both have _once variants that prevent re-including the same file: require_once and include_once.
Answer
include gives a warning on failure; require stops execution with a fatal error.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.