Archived
What are the differences between abstract class and interface?
-1
Community Evaluations
Umar
24/07/2022
You can define a private method in an abstract class.
<?php
abstract class A {
abstract public function fn();
protected function fn2()
{
$this->fn3();
}
private function fn3()
{
echo 'fn3';
}
}
class B extends A {
public function fn()
{
echo 'fn';
}
public function __construct() {
$this->fn2();
}
}
new B();