Advanced PHP
June 3, 2026 1 min read

PHP OOP Method and Property Overriding

HS
HEMANT SINGH
Technical Writer & Educator

In a PHP programs, if child class contain properties and methods with same as base class is called overriding properties and methods.

class Account{
	public $name="Name of account";	
}

class Employee extends Account{
	public $name="Name of Employee";
}

$emp = new Employee();
echo $emp->name;