PHP OOP Overriding properties and methods

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;
© 2016 - 2022, All Rights are Reserved.