Jump to content

Undefined constant, but it is defined


AntonZelenin

Recommended Posts

Here is the code

define ('ROOT', __DIR__);

require ROOT.'/scripts/autoload.php';

and the file autoload.php

function __autoload($class_name)
{
    $array_paths = array(
        ROOT.'/classes/'
    );

//another code

}

And it says that ROOT is undefined. If I define ROOT in autoload.php - it says that constant is already defined. What am I doing wrong?)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.