I've been working on a PHP project and I came across something called "abstract constants". I read that abstract constants are constants that can be defined in an abstract class and then inherited by its child classes. However, I'm wondering if there is a way to force a child class to define a constant that is already defined in the abstract class.
Let me give you a bit of context. In my project, I have an abstract class called "Animal" that has a constant called "SOUND". This constant represents the sound that an animal makes. Now, I have several child classes that extend the "Animal" class such as "Cat", "Dog", and "Bird". I want to make sure that each child class defines its own "SOUND" constant, as each animal makes a unique sound.
So, my question is: Is there a way in PHP to force a child class to define a constant that is already defined in the abstract parent class? Or is there any other way I can ensure that each child class defines its own unique "SOUND" constant?
Looking forward to your suggestions and solutions. Thanks in advance!