What are the potential pitfalls of using class constants in PHP, especially in relation to visibility flags and PHP versions?

Using class constants in PHP can lead to potential pitfalls related to visibility flags and compatibility with different PHP versions. To avoid these issues, it is recommended to define class constants with the `const` keyword and specify the visibility explicitly as `public`, `protected`, or `private`.

class MyClass {
    public const MY_CONSTANT = 'value';
}