name = $name;
$this->age = $age;
}
public static function validatePass($pass){
if(strlen($pass) >= self::$minPassLenght){
return true;
}else{
return false;
}
}
}
class Customer extends User {
private $balance;
public function __construct($name, $age, $balance){
parent::__construct($name,$age);
$this->balance = $balance;
}
public function pay($amount){
return $this->name . ' paid $' . $amount;
}
// public function getBalance(){
// return $this->balance;
// }
public function __get($property){
if(property_exists($this, $property)){
return $this->$property;
}
}
public function __set($property, $value){
if(property_exists($this, $property)){
$this->$property = $value;
}
// return $this;
}
}
$customer1 = new Customer('Kris', 25, 3500);
echo $customer1->pay(2000);
echo "
";
$customer1->__set('balance', 65010111);
echo $customer1->__get('balance');
echo "
";
$password = 'blqasd';
if(User::validatePass($password)){
echo 'Password valid!';
}else{
echo 'Password invalid!';
}