I was started my learing in OOP and I make a class but I have a problem now. This is my little code:
class User {
public $name;
public $age;
public $city;
public function setDate($setName, $setAge, $setCity)
{
$this->name = $setName;
$this->age = $setAge;
$this->city = $setCity;
}
public function pullDate()
{
return $this->name;
return $this->age;
return $this->city;
}
}
$newUser = new User;
$newUser->setDate('Adrian', '23', 'Poland');
echo $newUser->pullDate();
And when I get variable by echo $newUser->pullDate(); in response recerive only 'Adrian' ... How I can fix it?
Thanks for help!