The final keyword is used to declare that a method or class cannot be overridden by a subclass : final « Class « PHP






The final keyword is used to declare that a method or class cannot be overridden by a subclass

 
<?
    class Dog {
            private $Name;
            private $DogTag;
            final public function bark( ) {
                    print "Woof!\n";
            }
    }
?>
  
  








Related examples in the same category

1.final class
2.Declaring Final Classes and Methods
3.Final Methods
4.final keyword can be used to declare a class uninheritable