<?php
class Point {
    private $x=0;
    private $y=0;
    public function setPoint($x,$y){
        $this->x=$x;
        $this->y=$y;
    }
    public function showPoint(){
        echo "(",  $this->x,",",  $this->y,")\n";
    }
}
class Line {
    private $p1;
    private $p2;
    public function setLine($p1,$p2){
        $this->p1=$p1;
        $this->p2=$p2;
    }
    public function showLine(){
        $this->p1->showPoint();
        $this->p2->showPoint();
    }
}
$p1=$p2=new Point;
$p1->setPoint(5, 8);
$p2->setPoint(1, 2);
$l=new Line;
$l->setLine($p1, $p2);
$l->showLine();