Let’s explore use of final keyword in PHP in depth.
When we need to use final keyword to class then we just need to prefix class name with final keyword and for a method as well we need to do the same step by prefixing method name as final.
In the above examples, we first defined class classA as final which means now all the properties and methods are final and in the second example methodA is final which means now only methodA is final.
PHPs object oriented is quite late but we need to keep in mind that we can make class as a final whenever we feel that this class should never be extended.