<?php
Class User {
protected $name;
protected $age;
public function __construct($name,$age){
$this->name = $name;
$this->age = $age;
}
}
class Customer extends User {
private $balance;
public function __construct($name,$age,$balance) {
$this->balance = $balance;
parent::__construct($name,$age);
}
public function getBalance() {
return $this->balance;
}
public function pay($amount) {
return $this->name . ' paid $'. $amount;
}
}
$customer1 = new Customer('John',33, 500);
echo $customer1->getBalance();