fork download
  1. <?php
  2.  
  3. class Point2D
  4. {
  5. private $x;
  6. private $y;
  7.  
  8. public function __construct($x, $y)
  9. {
  10. $this->x = x;
  11. $this->y = y;
  12. }
  13.  
  14. public function getX()
  15. {
  16. return $this->x;
  17. }
  18.  
  19. public function getY()
  20. {
  21. return $this->y;
  22. }
  23. }
  24.  
  25. class Point3D extends Point2D
  26. {
  27. private $z;
  28.  
  29. public function __construct($x, $y, $z)
  30. {
  31. parent::__construct($x, $y);
  32. $this->z = $z;
  33. }
  34.  
  35. public function getZ()
  36. {
  37. return $this->z;
  38. }
  39. }
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
Standard output is empty