How does the PHP version affect the ability to access constants?

The PHP version can affect the ability to access constants if the constant is defined using the `const` keyword inside a class. In PHP 5, constants defined in classes cannot be accessed using the `::` syntax outside of the class definition. This limitation was removed in PHP 7, allowing constants defined in classes to be accessed using the `::` syntax from outside the class.

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

// Accessing constant in PHP 7+
echo MyClass::MY_CONSTANT;