Single Inheritance

In single inheritance, one class extends one class only

Example

<?php
class a
{
public function function_a(){
echo “class A”;
}
}

class b extends a
{
public function function_b(){
echo “class B”;
}
}

echo b::function_b();
echo b::function_a();

?>

Share