class makeAccount {
public $username;
public function __construct ($username,$password) {
$this->username = $username;
}
public function password($password) {
if(isset($password)) {
$this->password = $password;
return;
}
}
}
$user_1 = new makeAccount("abc123","12345");
print $user_1->password("12345");
I am new to php. I am just wondering how to make a private property. I want to have a password property that is private. Is there something wrong with my code?