How do you access class constants in PHP?

To access class constants in PHP, you can use the scope resolution operator (::) followed by the class name and the constant name. Class constants are defined using the "const" keyword within the class definition and can be accessed without creating an instance of the class.

class MyClass {
    const MY_CONSTANT = 'Hello World';
}

echo MyClass::MY_CONSTANT;