Private Visibility
The private keyword is part of the three keywords to define visibility of a method, property or class constant. It is the strictest level of visibility: it restricts usage to the current class only. A child class can redefine it, but it cannot the parent’s: the reverse is also true.
The private keyword cannot be used with the final keyword: a private method is not visible in the child classes, and can’t also be overridden.
The private keyword cannot be used with the abstract keyword: a private method is not visible in the child classes, and can’t also be overridden.
<?php
class Elephpant {
private const HABITAT = 1;
final public function method() {
echo self::HABITAT;
}
}
?>