Advanced PHP
June 3, 2026 1 min read

PHP OOP Inheritance: Reusing Properties Across Classes

HS
HEMANT SINGH
Technical Writer & Educator

PHP OOP inheritance

Inheritance is an oops concepts using inheritance we can reuse the properties on other class.

or we can say it is a mechanism by which we can inherit one class propeties to other class.

Example

class Account{
	public $name, $age;
	public function __construct($name="Guest", $age=0){
		$this->name = $name;
		$this->age = $age;
	}
	public function display(){
		echo "
		Name: $this->name <br>
		Age: $this->age <hr>
		";
	}
}

class Employee extends Account{

}

$emp = new Employee("Ankit", 20);
$emp->display();