Page 1 of 1
different require_once.
Posted: Tue Dec 13, 2005 5:35 am
by jmut
What is the difference if any between these two require statements.
Code: Select all
require_once(dirname(__FILE__) . '/errors.php');
require_once('./errors.php');
Re: different require_once.
Posted: Tue Dec 13, 2005 6:09 am
by Weirdan
jmut wrote:What is the difference if any between these two require statements.
Code: Select all
require_once(dirname(__FILE__) . '/errors.php');
require_once('./errors.php');
First form is guaranteed to ignore
include_path and the path specified is always relative to the path of the current file (while the second form may produce some unexpected results when you have a chain of included files and files have the same name on different levels of directory tree, see
this comment)