<?php
class Score
{
private $subject;
private $points;
public function __construct($subject, $points)
{
$this->subject = $subject;
$this->points = $points;
}
}
class User
{
private $name;
private $score;
public function __construct($name, $score)
{
$this->name = $name;
$this->score = $score;
}
}
$user1 = new User("Taro", new Score("Math", 70));
$user2 = new User("Jiro", new Score("English", 90));