<?php
class User
{
public $name;
public $score;
public function __construct($name, $score)
{
$this->name = $name;
$this->score = $score;
}
public function getInfo()
{
return "{$this->name}, {$this->score}";
}
}
$user1 = new User("Taro", 70);
$user2 = new User("Jiro", 90);
$user1->score = 900;
echo $user1->getInfo() . PHP_EOL;
echo $user2->getInfo() . PHP_EOL;