"; } function out() { echo $xx; } function getX() { return $xx; } } class Y extends X { function Y($_y) { static $yy = $_y; echo '$yy='.$yy."
"; } function getY() { return $yy; } } class points extends Y { function points($_x, $_y) { $this->X($_x); $this->Y($_y); } function output() { $xx=$this->getX(); $yy=$this->getY(); echo "($xx,$yy)"; } } $an_x = new X(5); $a_y = new Y(7); echo '$an_x contains '.$an_x->out()."
"; echo '$a_y contains '.$a_y->$yy."
"; $a_point = new points(3,5); $a_point->output(); ?>