This example demonstrates that a final method cannot be overridden in a child class
class myClass {
    final function myFunction() {
        echo "Parent";
    }
}
// ERROR because a final method cannot be overridden in child classes.
class myClass2 extends myClass {
    function myFunction() {
        echo "Child";
    }
}
The above code will generate the following error:
Fatal error: Cannot override final method myClass::myFunction() in /home/user/scripts/code.php on line 9
by Valeri Tandilashvili
4 years ago
PHP
3
Pro tip: use ```triple backticks around text``` to write in code fences