array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.require.php', 1 => 'require', ), 'up' => array ( 0 => 'language.control-structures.php', 1 => 'Control Structures', ), 'prev' => array ( 0 => 'function.return.php', 1 => 'return', ), 'next' => array ( 0 => 'function.include.php', 1 => 'include', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'language/control-structures/require.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
require
is identical to include
except upon failure it will also produce a fatal E_COMPILE_ERROR
level error. In other words, it will halt the script whereas
include only emits a warning
(E_WARNING
) which allows the script to continue.
See the include documentation for how this works.