I am writing this simple code. I used this class in PHP 10 minutes ago and now when I did it again it gives me this error. I cannot see the difference

<?php

class user
{
	public $Username;
	public $FullName;
	public $Password;
	public $LoggedIn;
	public $JoinDate;

	public function changePassword($newPass)
	{
		$this->Password = md5($newPass);
	{
}

$user = new user();

$user->Username = 'Username';
$user->FullName = 'Name';
$user->Password = 'password';

echo $user->Username;
echo $user->changePassword($newPass);

?>

This is the error I get:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\Lessons\Arrays\test.php on line 26

I would really appreicate someones help in this as I am new to OOP in PHP.

Thanks

Your } for your changePassword function is a {. Also, you don't need to specify public for all of those variables, scope defaults to public.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.