PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php class Point { public $x; public $y; public function __construct($x, $y) { $this->x = $x; $this->y = $y; } } class Segment { public $beginPoint; public $endPoint; public function __construct($beginPoint, $endPoint) { $this->beginPoint = $beginPoint; $this->endPoint = $endPoint; } } function reverse($point1, $point2) { $point1 = new Point(); $point1->x = $point2->x; $point1->y = $point2->y = $y; $newSegment = segment($point1, $point2); } $point1 = new Point(1, 10); $point2 = new Point(11, -3); $t = reverse($point1, $point2); print_r($t);
Show:  
Copy Clear