I use constants to set various configuration variables in a script.
The INC_PATH constant is defined in a script that includes a class library.
define('INC_PATH',$_SERVER['DOCUMENT_ROOT'].'includes/');
include('class.lib.php');
The class library contains various include lines ('someClass.php'). It also contains:
require(INC_PATH.'DB.class.php');
The class library issues a notification:
Use of undefined constant INC_PATH - assumed 'INC_PATH'
How can the class library not see that the constant INC_PATH is defined? I thought constants are global?
source
share