<?php

class Point {
   var $x, $y;

   function __construct($x, $y) {
      $this->x = $x;
      $this->y = $y;
   }

   function distance($p) {
       return sqrt(($this->x - $p->x) * ($this->x - $p->x) + ($this->y - $p->y) * ($this->y - $p->y));
   }
}

$a = new Point(3, 2);
$b  = new Point(5, 7);

print $a->distance($b);

?>