define('STATUS_ACTIVE', 1);
define('STATUS_INACTIVE', 2);
define('STATUS_ARCHIVED', 3);
define('MAX_LOGIN_ATTEMPTS', 5);
define('TAX_RATE', 0.1);

// 상수 사용 시
$totalAmount = $subTotal + ($subTotal * TAX_RATE);

// 상수 미사용 시
$taxRate = 0.1;
$totalAmount = $subTotal + ($subTotal * $taxRate);
define(string $constant_name, mixed $value, bool $case_insensitive = false): bool
define('MY_CONSTANT', 10);
echo MY_CONSTANT // 출력: 10
class MyClass {
    const CLASS_CONSTANT = 100;

    public function getConstantValue() {
        return self::CLASS_CONSTANT; // self::CONSTANT_NAME 형식으로 접근할 수 있음
    }
}
echo MyClass::MY_CONSTANT; // 출력: 10, 클래스 이름과 :: 연산자를 사용해서 접근할 수 있음
define('GLOBAL_CONSTANT', 200);

class AnotherClass {
    public function getConstantValue() {
        return GLOBAL_CONSTANT;
    }
}

echo GLOBAL_CONSTANT; // 출력: 200

$anotherClass = new AnotherClass();
echo $anotherClass->getConstantValue(); // 출력: 200
class MyClass {
    const CLASS_CONSTANT = 100;
}

echo MyClass::CLASS_CONSTANT; // 출력: 100

// 클래스 내부 상수를 바로 사용하면 경고 발생
// echo CLASS_CONSTANT; // 경고: Use of undefined constant CLASS_CONSTANT - assumed 'CLASS_CONSTANT'
define('FRUITS', ['apple', 'orange', 'banana']);
echo FRUITS[0]; // 출력: apple
define('FRUITS', ['apple', 'orange', 'banana']);
FRUITS[0] = 'grape'; // Fatal Eror