class Point { public $x, $y; public function __construct ($x, $y) { $this->x = $x; $this->y = $y; } public function inverted() { return new Point( $this->y, $this->x ); } }