A final method is a method that cannot be overridden. To declare a method as final, you need to prefix the function name with the ‘final’ keyword.
( ! ) Fatal error: Cannot override final method BaseClass::myMethod() in D:\wamp\www\OOPs\index.php on line 13
DerivedClass extends from BaseClass. BaseClass has the method myMethod() declared as final and this cannot be overridden. In this case the compiler causes a compile error.
Trending Tutorials