Quiz · Classes and objects · lesson 7 of 11
Quiz — two names for one object
What does the program print?
<?php
class Point
{
public function __construct(public int $x) {}
}
$a = new Point(1);
$b = $a;
$c = clone $a;
$b->x = 5;
echo $a->x, ' ', $b->x, ' ', $c->x, "\n";